Commit Graph

5 Commits (4001130df1a74948cfa8be02b420953a84ab83e8)

Author SHA1 Message Date
Namhyung Kim 52b5c0d485 tools lib traceevent: Detect build environment changes
Cross compiling perf requires setting ARCH and CROSS_COMPILE variables,
but libtraceevent couldn't detect the changes so it ends up believing no
recompiling is required. Thus the linker failed like:

     LINK perf
 ../lib/traceevent//libtraceevent.a: member ../lib/traceevent//libtraceevent.a(event-parse.o) in archive is not an object
 collect2: ld returned 1 exit status
 make: *** [perf] Error 1

This patch fixes this by adding TRACEEVENT-CFLAGS file like
PERF-CFLAGS to track those changes.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1341559297-25725-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-07-25 11:54:06 -03:00
Namhyung Kim 860df5833e tools lib traceevent: Make dependency files regeneratable
Ingo reported that libtraceevent doesn't clean out dependency (.d) files
and it can cause a build error when the libgcc package upgraded:

 comet:~/tip/tools/perf> make -j
     SUBDIR ../lib/traceevent/
 make[1]: *** No rule to make target `/usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/stddef.h',
  needed by `event-parse.o'.  Stop.
 make: *** [../lib/traceevent//libtraceevent.a] Error 2

So this patch makes the .d files depends on the source and header files
also, so that it can be re-generated as needed.

NOTE: This code is copied from the GNU make manual page
(4.14 Generating Prerequisites Automatically).

Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1340343462-15556-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-06-29 13:28:12 -03:00
Namhyung Kim 6545e3a8f0 tools lib traceevent: Teach [ce]tags about libtraceeevent error codes
As we use a macro trick to sync each error codes with its description
string, teach [ce]tags to process them properly.

This patch modifies the libtraceevent's Makefile not a kernel one.

Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/n/tip-3101nsbg52glxdqih291qj74@git.kernel.org
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1340352615-20737-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-06-29 13:28:12 -03:00
Konstantin Stepanyuk f526a4ce26 tools lib traceevent: Fix clean target in Makefile
Dependency files were not cleaned up. Add missing space to fix the issue.

Signed-off-by: Konstantin Stepanyuk <konstantin.stepanyuk@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1340833934-18783-1-git-send-email-konstantin.stepanyuk@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-06-29 13:28:11 -03:00
Steven Rostedt f7d82350e5 tools/events: Add files to create libtraceevent.a
Copy over the files from trace-cmd to the Linux tools directory
such that applications like perf and latencytrace can use the
more advanced parsing code.

Because some of the file names of perf conflict with trace-cmd file
names, the trace-cmd files have been renamed as follows:

 parse-events.c ==> event-parse.c
 parse-events.h ==> event-parse.h
 utils.h        ==> event-utils.h

The files have been updated to handle the changes to the header files
but other than that, they are identical to what was in the trace-cmd
repository. The history of these files, including authorship is
available at the git repo:

 git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git

The Makefile was also copied over, but most of it was removed to
focus on the parse-events code first. The parts of the Makefile for
the plugins have also been removed, but will be added back when the
plugin code is copied over as well. But that may be in its own
separate directory.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Arun Sharma <asharma@fb.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
2012-04-25 12:28:28 +02:00