WSU pTop is a simple and effcient process-level power profiling tool

$ls
conf  doc  makefile  objects.mk  sources.mk  src
$make all
cc    -c -o src/avltree.o src/avltree.c
In file included from src/avltree.c:12:0:
src/eperf.h: In function ‘sys_perf_event_open’:
src/eperf.h:32:17: error: ‘__NR_perf_counter_open’ undeclared (first use in this function)
  return syscall(__NR_perf_counter_open, attr, pid, cpu, group_fd, flags);
                 ^
src/eperf.h:32:17: note: each undeclared identifier is reported only once for each function it appears in
make: *** [src/avltree.o] Error 1
$

$ mkdir gitpower
$ cd gitpower/
$ ls
$ git clone https://github.com/hch-im/ptop.git
Cloning into 'ptop'...
remote: Reusing existing pack: 38, done.
remote: Total 38 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (38/38), done.
Checking connectivity... done
$ ls
ptop
$ cd ptop/
$ ls
conf  makefile  objects.mk  README.md  sources.mk  src
$ make all
cc    -c -o src/avltree.o src/avltree.c
cc    -c -o src/common.o src/common.c
In file included from src/cpu_stats.h:30:0,
                 from src/common.c:38:
src/database.h:30:25: fatal error: mysql/mysql.h: No such file or directory
 #include 
                         ^
compilation terminated.
make: *** [src/common.o] Error 1
$ 

$ make all
cc    -c -o src/common.o src/common.c
cc    -c -o src/cpu_stats.o src/cpu_stats.c
cc    -c -o src/database.o src/database.c
cc    -c -o src/display.o src/display.c
src/display.c:30:21: fatal error: ncurses.h: No such file or directory
 #include 
                     ^
compilation terminated.
make: *** [src/display.o] Error 1
$ 


$ make all
cc    -c -o src/display.o src/display.c
cc    -c -o src/energy.o src/energy.c
cc    -c -o src/eperf.o src/eperf.c
cc    -c -o src/m_stats.o src/m_stats.c
cc    -c -o src/pid_stats.o src/pid_stats.c
cc    -c -o src/ptop.o src/ptop.c
Building target: pTop
Invoking: GCC C Linker
gcc  -o"pTop"  ./src/avltree.o ./src/common.o ./src/cpu_stats.o ./src/database.o ./src/display.o ./src/energy.o ./src/eperf.o ./src/m_stats.o ./src/pid_stats.o ./src/ptop.o   -lmysqlclient -lncurses
Finished building target: pTop
rm -rf  ./src/avltree.o ./src/common.o ./src/cpu_stats.o ./src/database.o ./src/display.o ./src/energy.o ./src/eperf.o ./src/m_stats.o ./src/pid_stats.o ./src/ptop.o  ./src/avltree.d ./src/common.d ./src/cpu_stats.d ./src/database.d ./src/display.d ./src/energy.d ./src/eperf.d ./src/m_stats.d ./src/pid_stats.d ./src/ptop.d 
Finished clean: pTop
$