perf evsel: Introduce rawptr() method
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 26 Sep 2012 23:22:00 +0000 (20:22 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 26 Sep 2012 23:22:00 +0000 (20:22 -0300)
Will be used for things like the args field in the raw_syscalls:sys_enter
tracepoint.

Implement strval with it, its basicaly strval returning void *.

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@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-v9x3q9rv4caxtox7wtjpchq5@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/evsel.c
tools/perf/util/evsel.h

index 6f2a8c30413ebd06902582bdaf3a1247b38760e2..e992b67e0f3a5f616ebdd8defc4673e473adbdc9 100644 (file)
@@ -1104,7 +1104,7 @@ struct format_field *perf_evsel__field(struct perf_evsel *evsel, const char *nam
        return pevent_find_field(evsel->tp_format, name);
 }
 
-char *perf_evsel__strval(struct perf_evsel *evsel, struct perf_sample *sample,
+void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample,
                         const char *name)
 {
        struct format_field *field = perf_evsel__field(evsel, name);
index 25043ff17fd7ad6799563f97fd32b93b0485503a..2c490502010588505e972b112a0f4d4e9b6b9295 100644 (file)
@@ -128,11 +128,18 @@ void perf_evsel__close(struct perf_evsel *evsel, int ncpus, int nthreads);
 
 struct perf_sample;
 
-char *perf_evsel__strval(struct perf_evsel *evsel, struct perf_sample *sample,
+void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample,
                         const char *name);
 u64 perf_evsel__intval(struct perf_evsel *evsel, struct perf_sample *sample,
                       const char *name);
 
+static inline char *perf_evsel__strval(struct perf_evsel *evsel,
+                                      struct perf_sample *sample,
+                                      const char *name)
+{
+       return perf_evsel__rawptr(evsel, sample, name);
+}
+
 struct format_field;
 
 struct format_field *perf_evsel__field(struct perf_evsel *evsel, const char *name);