aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-trace.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2014-02-10 12:09:48 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-02-13 15:28:31 -0500
commit844ae5b46c08dbc7ba695b543c023f9cf3bbf9ff (patch)
tree57582104e9cf5984cccd2c4814b94de070055ec4 /tools/perf/builtin-trace.c
parent79d26a6a19ace19faabf8d8d27d3430be2e26d34 (diff)
perf trace: Fix ioctl 'request' beautifier build problems on !(i386 || x86_64) arches
Supporting decoding the ioctl 'request' parameter needs more work to properly support more architectures, the current approach doesn't work on at least powerpc and sparc, as reported by Ben Hutchings in http://lkml.kernel.org/r/1391593985.3003.48.camel@deadeye.wl.decadent.org.uk . Work around that by making it to be ifdefed for the architectures known to work with the current, limited approach, i386 and x86_64 till better code is written. Reported-by: Ben Hutchings <ben@decadent.org.uk> Acked-by: Ben Hutchings <ben@decadent.org.uk> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: <stable@vger.kernel.org> # 3.13 Fixes: 78645cf3ed32 ("perf trace: Initial beautifier for ioctl's 'cmd' arg") Link: http://lkml.kernel.org/n/tip-ss04k11insqlu329xh5g02q0@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r--tools/perf/builtin-trace.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 619d11c47a91..6aa6fb6f7bd9 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -283,6 +283,11 @@ static size_t syscall_arg__scnprintf_strarray(char *bf, size_t size,
283 283
284#define SCA_STRARRAY syscall_arg__scnprintf_strarray 284#define SCA_STRARRAY syscall_arg__scnprintf_strarray
285 285
286#if defined(__i386__) || defined(__x86_64__)
287/*
288 * FIXME: Make this available to all arches as soon as the ioctl beautifier
289 * gets rewritten to support all arches.
290 */
286static size_t syscall_arg__scnprintf_strhexarray(char *bf, size_t size, 291static size_t syscall_arg__scnprintf_strhexarray(char *bf, size_t size,
287 struct syscall_arg *arg) 292 struct syscall_arg *arg)
288{ 293{
@@ -290,6 +295,7 @@ static size_t syscall_arg__scnprintf_strhexarray(char *bf, size_t size,
290} 295}
291 296
292#define SCA_STRHEXARRAY syscall_arg__scnprintf_strhexarray 297#define SCA_STRHEXARRAY syscall_arg__scnprintf_strhexarray
298#endif /* defined(__i386__) || defined(__x86_64__) */
293 299
294static size_t syscall_arg__scnprintf_fd(char *bf, size_t size, 300static size_t syscall_arg__scnprintf_fd(char *bf, size_t size,
295 struct syscall_arg *arg); 301 struct syscall_arg *arg);
@@ -843,6 +849,10 @@ static size_t syscall_arg__scnprintf_signum(char *bf, size_t size, struct syscal
843 849
844#define SCA_SIGNUM syscall_arg__scnprintf_signum 850#define SCA_SIGNUM syscall_arg__scnprintf_signum
845 851
852#if defined(__i386__) || defined(__x86_64__)
853/*
854 * FIXME: Make this available to all arches.
855 */
846#define TCGETS 0x5401 856#define TCGETS 0x5401
847 857
848static const char *tioctls[] = { 858static const char *tioctls[] = {
@@ -864,6 +874,7 @@ static const char *tioctls[] = {
864}; 874};
865 875
866static DEFINE_STRARRAY_OFFSET(tioctls, 0x5401); 876static DEFINE_STRARRAY_OFFSET(tioctls, 0x5401);
877#endif /* defined(__i386__) || defined(__x86_64__) */
867 878
868#define STRARRAY(arg, name, array) \ 879#define STRARRAY(arg, name, array) \
869 .arg_scnprintf = { [arg] = SCA_STRARRAY, }, \ 880 .arg_scnprintf = { [arg] = SCA_STRARRAY, }, \
@@ -945,9 +956,16 @@ static struct syscall_fmt {
945 { .name = "getrlimit", .errmsg = true, STRARRAY(0, resource, rlimit_resources), }, 956 { .name = "getrlimit", .errmsg = true, STRARRAY(0, resource, rlimit_resources), },
946 { .name = "ioctl", .errmsg = true, 957 { .name = "ioctl", .errmsg = true,
947 .arg_scnprintf = { [0] = SCA_FD, /* fd */ 958 .arg_scnprintf = { [0] = SCA_FD, /* fd */
959#if defined(__i386__) || defined(__x86_64__)
960/*
961 * FIXME: Make this available to all arches.
962 */
948 [1] = SCA_STRHEXARRAY, /* cmd */ 963 [1] = SCA_STRHEXARRAY, /* cmd */
949 [2] = SCA_HEX, /* arg */ }, 964 [2] = SCA_HEX, /* arg */ },
950 .arg_parm = { [1] = &strarray__tioctls, /* cmd */ }, }, 965 .arg_parm = { [1] = &strarray__tioctls, /* cmd */ }, },
966#else
967 [2] = SCA_HEX, /* arg */ }, },
968#endif
951 { .name = "kill", .errmsg = true, 969 { .name = "kill", .errmsg = true,
952 .arg_scnprintf = { [1] = SCA_SIGNUM, /* sig */ }, }, 970 .arg_scnprintf = { [1] = SCA_SIGNUM, /* sig */ }, },
953 { .name = "linkat", .errmsg = true, 971 { .name = "linkat", .errmsg = true,