From: Dmitry V. Levin Date: Sat, 1 Aug 2015 20:28:21 +0000 (+0000) Subject: desc.c: move perf_event_open parser to a separate file X-Git-Tag: v4.11~304 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d60cf753e351c481b38610e4a1b8c5c464e5d37;p=strace desc.c: move perf_event_open parser to a separate file * perf.c: New file. * Makefile.am (strace_SOURCES): Add it. * desc.c (sys_perf_event_open): Move to perf.c. --- diff --git a/Makefile.am b/Makefile.am index 4c8cd544..8326813a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -76,6 +76,7 @@ strace_SOURCES = \ open.c \ or1k_atomic.c \ pathtrace.c \ + perf.c \ personality.c \ poll.c \ prctl.c \ diff --git a/desc.c b/desc.c index 32327c26..8931ca73 100644 --- a/desc.c +++ b/desc.c @@ -34,16 +34,12 @@ #ifdef HAVE_SYS_EPOLL_H # include #endif -#ifdef HAVE_LINUX_PERF_EVENT_H -# include -#endif #include "xlat/fcntlcmds.h" #include "xlat/fdflags.h" #include "xlat/flockcmds.h" #include "xlat/lockfcmds.h" #include "xlat/notifyflags.h" -#include "xlat/perf_event_open_flags.h" /* * Assume that F_SETLK64, F_SETLKW64, and F_GETLK64 are either defined @@ -605,16 +601,3 @@ SYS_FUNC(eventfd2) { return do_eventfd(tcp, 1); } - -SYS_FUNC(perf_event_open) -{ - printaddr(tcp->u_arg[0]); - tprintf(", %d, %d, %d, ", - (int) tcp->u_arg[1], - (int) tcp->u_arg[2], - (int) tcp->u_arg[3]); - printflags(perf_event_open_flags, tcp->u_arg[4], - "PERF_FLAG_???"); - - return RVAL_DECODED; -} diff --git a/perf.c b/perf.c new file mode 100644 index 00000000..60bbd3a2 --- /dev/null +++ b/perf.c @@ -0,0 +1,19 @@ +#include "defs.h" + +#ifdef HAVE_LINUX_PERF_EVENT_H +# include +#endif + +#include "xlat/perf_event_open_flags.h" + +SYS_FUNC(perf_event_open) +{ + printaddr(tcp->u_arg[0]); + tprintf(", %d, %d, %d, ", + (int) tcp->u_arg[1], + (int) tcp->u_arg[2], + (int) tcp->u_arg[3]); + printflags(perf_event_open_flags, tcp->u_arg[4], "PERF_FLAG_???"); + + return RVAL_DECODED; +}