Skip to content

Commit

Permalink
rebase pevent code to upstream kernel version of tools lib traceevent.
Browse files Browse the repository at this point in the history
This will allow me to keep update and align with the libary code until it is usable without
building it local.
  • Loading branch information
Chris E Ferron committed Jul 27, 2012
1 parent 6e14e6e commit ce22d9d
Show file tree
Hide file tree
Showing 19 changed files with 853 additions and 222 deletions.
15 changes: 7 additions & 8 deletions Android.mk
Expand Up @@ -5,7 +5,7 @@ LOCAL_MODULE_TAGS := debug
LOCAL_SHARED_LIBRARIES := libstlport \
libnl \
libpci \
libparseevent \
libtraceevnet \
LOCAL_MODULE := powertop

#LOCAL_CFLAGS += -Wall -O2 -g -fno-omit-frame-pointer -fstack-protector -Wshadow -Wformat -D_FORTIFY_SOURCE=2
Expand Down Expand Up @@ -66,12 +66,11 @@ LOCAL_SRC_FILES += \
src/devlist.cpp \
src/calibrate/calibrate.cpp \
src/lib.cpp \
pevent/parse-events.c \
pevent/parse-filter.c \
pevent/trace-seq.c \
pevent/parse-events.h \
pevent/parse-utils.c \
pevent/util.h

traceevent/event-parse.c \
traceevent/event-parse.h \
traceevent/event-utils.h \
traceevent/parse-filter.c \
traceevent/parse-utils.c \
traceevent/trace-seq.c

include $(BUILD_EXECUTABLE)
2 changes: 1 addition & 1 deletion Makefile.am
@@ -1,6 +1,6 @@
AUTOMAKE_OPTIONS = subdir-objects
ACLOCAL_AMFLAGS = -I m4

SUBDIRS = pevent src po doc
SUBDIRS = traceevent src po doc

EXTRA_DIST = README TODO Android.mk COPYING autogen.sh
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -5,7 +5,7 @@ AC_PREREQ([2.68])
AC_INIT([powertop], [2.0], [powertop@lists.01.org])
AM_INIT_AUTOMAKE([-Wall foreign ])
AC_LANG([C++])
AC_CONFIG_FILES([Makefile src/Makefile pevent/Makefile po/Makefile.in doc/Makefile])
AC_CONFIG_FILES([Makefile src/Makefile traceevent/Makefile po/Makefile.in doc/Makefile])
AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
Expand Down
5 changes: 0 additions & 5 deletions pevent/Makefile.am

This file was deleted.

2 changes: 1 addition & 1 deletion src/Makefile.am
Expand Up @@ -38,7 +38,7 @@ powertop_CXXFLAGS = -fno-omit-frame-pointer -fstack-protector -Wall -Wshadow -Wf

powertop_CPPFLAGS = -D_FORTIFY_SOURCE=2 $(NCURSES_CFLAGS) $(PCIUTILS_CFLAGS) $(LIBNL_CFLAGS) $(GLIB2_CFLAGS) $(LIBZ_CFLAGS) -DLOCALEDIR=\"$(localedir)\"

powertop_LDADD = ../pevent/libparseevent.la
powertop_LDADD = ../traceevent/libtraceevnet.la

AM_LDFLAGS = $(LIBS) $(NCURSES_LIBS) $(PCIUTILS_LIBS) $(LIBNL_LIBS) $(LIBZ_LIBS) $(PTHREAD_LIBS) $(RESOLV_LIBS)

Expand Down
2 changes: 1 addition & 1 deletion src/cpu/cpu.cpp
Expand Up @@ -903,7 +903,7 @@ struct power_entry {
void perf_power_bundle::handle_trace_point(void *trace, int cpunr, uint64_t time)
{
struct event_format *event;
struct record rec; /* holder */
struct pevent_record rec; /* holder */
class abstract_cpu *cpu;
int type;

Expand Down
4 changes: 3 additions & 1 deletion src/perf/perf.h
Expand Up @@ -27,10 +27,12 @@

#include <iostream>


extern "C" {
#include "../pevent/parse-events.h"
#include "../traceevent/event-parse.h"
}


using namespace std;

class perf_event {
Expand Down
4 changes: 2 additions & 2 deletions src/process/do_process.cpp
Expand Up @@ -186,7 +186,7 @@ int dont_blame_me(char *comm)
return 0;
}

static void dbg_printf_pevent_info(struct event_format *event, struct record *rec)
static void dbg_printf_pevent_info(struct event_format *event, struct pevent_record *rec)
{
static struct trace_seq s;

Expand Down Expand Up @@ -216,7 +216,7 @@ static char * get_pevent_field_str(void *trace, struct event_format *event, stru
void perf_process_bundle::handle_trace_point(void *trace, int cpu, uint64_t time)
{
struct event_format *event;
struct record rec; /* holder */
struct pevent_record rec; /* holder */
struct format_field *field;
unsigned long long val;
int type;
Expand Down
113 changes: 113 additions & 0 deletions traceevent/.deps/event-parse.Plo
@@ -0,0 +1,113 @@
event-parse.lo: event-parse.c /usr/include/stdio.h \
/usr/include/features.h /usr/include/sys/cdefs.h \
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
/usr/include/gnu/stubs-64.h \
/usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/stddef.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdio.h /usr/include/stdlib.h \
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
/usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/bits/byteswap.h /usr/include/xlocale.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/bits/time.h /usr/include/sys/sysmacros.h \
/usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/ctype.h /usr/include/errno.h \
/usr/include/bits/errno.h /usr/include/linux/errno.h \
/usr/include/asm/errno.h /usr/include/asm-generic/errno.h \
/usr/include/asm-generic/errno-base.h event-parse.h /usr/include/regex.h \
event-utils.h

/usr/include/stdio.h:

/usr/include/features.h:

/usr/include/sys/cdefs.h:

/usr/include/bits/wordsize.h:

/usr/include/gnu/stubs.h:

/usr/include/gnu/stubs-64.h:

/usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/stddef.h:

/usr/include/bits/types.h:

/usr/include/bits/typesizes.h:

/usr/include/libio.h:

/usr/include/_G_config.h:

/usr/include/wchar.h:

/usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/stdarg.h:

/usr/include/bits/stdio_lim.h:

/usr/include/bits/sys_errlist.h:

/usr/include/bits/stdio.h:

/usr/include/stdlib.h:

/usr/include/bits/waitflags.h:

/usr/include/bits/waitstatus.h:

/usr/include/endian.h:

/usr/include/bits/endian.h:

/usr/include/bits/byteswap.h:

/usr/include/xlocale.h:

/usr/include/sys/types.h:

/usr/include/time.h:

/usr/include/sys/select.h:

/usr/include/bits/select.h:

/usr/include/bits/sigset.h:

/usr/include/bits/time.h:

/usr/include/sys/sysmacros.h:

/usr/include/bits/pthreadtypes.h:

/usr/include/alloca.h:

/usr/include/string.h:

/usr/include/bits/string.h:

/usr/include/bits/string2.h:

/usr/include/ctype.h:

/usr/include/errno.h:

/usr/include/bits/errno.h:

/usr/include/linux/errno.h:

/usr/include/asm/errno.h:

/usr/include/asm-generic/errno.h:

/usr/include/asm-generic/errno-base.h:

event-parse.h:

/usr/include/regex.h:

event-utils.h:
112 changes: 112 additions & 0 deletions traceevent/.deps/parse-filter.Plo
@@ -0,0 +1,112 @@
parse-filter.lo: parse-filter.c /usr/include/stdio.h \
/usr/include/features.h /usr/include/sys/cdefs.h \
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
/usr/include/gnu/stubs-64.h \
/usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/stddef.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdio.h /usr/include/stdlib.h \
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
/usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/bits/byteswap.h /usr/include/sys/types.h \
/usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/bits/time.h \
/usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
/usr/include/alloca.h /usr/include/string.h /usr/include/xlocale.h \
/usr/include/bits/string.h /usr/include/bits/string2.h \
/usr/include/errno.h /usr/include/bits/errno.h \
/usr/include/linux/errno.h /usr/include/asm/errno.h \
/usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
event-parse.h /usr/include/regex.h event-utils.h /usr/include/ctype.h

/usr/include/stdio.h:

/usr/include/features.h:

/usr/include/sys/cdefs.h:

/usr/include/bits/wordsize.h:

/usr/include/gnu/stubs.h:

/usr/include/gnu/stubs-64.h:

/usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/stddef.h:

/usr/include/bits/types.h:

/usr/include/bits/typesizes.h:

/usr/include/libio.h:

/usr/include/_G_config.h:

/usr/include/wchar.h:

/usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/stdarg.h:

/usr/include/bits/stdio_lim.h:

/usr/include/bits/sys_errlist.h:

/usr/include/bits/stdio.h:

/usr/include/stdlib.h:

/usr/include/bits/waitflags.h:

/usr/include/bits/waitstatus.h:

/usr/include/endian.h:

/usr/include/bits/endian.h:

/usr/include/bits/byteswap.h:

/usr/include/sys/types.h:

/usr/include/time.h:

/usr/include/sys/select.h:

/usr/include/bits/select.h:

/usr/include/bits/sigset.h:

/usr/include/bits/time.h:

/usr/include/sys/sysmacros.h:

/usr/include/bits/pthreadtypes.h:

/usr/include/alloca.h:

/usr/include/string.h:

/usr/include/xlocale.h:

/usr/include/bits/string.h:

/usr/include/bits/string2.h:

/usr/include/errno.h:

/usr/include/bits/errno.h:

/usr/include/linux/errno.h:

/usr/include/asm/errno.h:

/usr/include/asm-generic/errno.h:

/usr/include/asm-generic/errno-base.h:

event-parse.h:

/usr/include/regex.h:

event-utils.h:

/usr/include/ctype.h:

0 comments on commit ce22d9d

Please sign in to comment.