diff options
author | Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> | 2016-06-30 02:14:19 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-06-30 07:37:32 -0400 |
commit | f4e47f9f7b0bcbb1069b93bd719a1d34fb37d933 (patch) | |
tree | 206fae79cff5c246ba87e862e2e37d4465243be7 /tools | |
parent | de8a63bd5076761fad4e236c93350fdf297708be (diff) |
perf evsel: Utility function to fetch arch
Add Utility function to fetch arch using evsel. (evsel->env->arch)
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Anton Blanchard <anton@ozlabs.org>
Cc: Daniel Axtens <dja@axtens.net>
Cc: David Laight <David.Laight@ACULAB.COM>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1467267262-4589-2-git-send-email-ravi.bangoria@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/evsel.c | 7 | ||||
-rw-r--r-- | tools/perf/util/evsel.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 1d8f2bbd38a7..0fea724e735c 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -2422,3 +2422,10 @@ int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target, | |||
2422 | err, strerror_r(err, sbuf, sizeof(sbuf)), | 2422 | err, strerror_r(err, sbuf, sizeof(sbuf)), |
2423 | perf_evsel__name(evsel)); | 2423 | perf_evsel__name(evsel)); |
2424 | } | 2424 | } |
2425 | |||
2426 | char *perf_evsel__env_arch(struct perf_evsel *evsel) | ||
2427 | { | ||
2428 | if (evsel && evsel->evlist && evsel->evlist->env) | ||
2429 | return evsel->evlist->env->arch; | ||
2430 | return NULL; | ||
2431 | } | ||
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 828ddd1c8947..86fed7a2932b 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h | |||
@@ -435,4 +435,6 @@ typedef int (*attr__fprintf_f)(FILE *, const char *, const char *, void *); | |||
435 | int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr, | 435 | int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr, |
436 | attr__fprintf_f attr__fprintf, void *priv); | 436 | attr__fprintf_f attr__fprintf, void *priv); |
437 | 437 | ||
438 | char *perf_evsel__env_arch(struct perf_evsel *evsel); | ||
439 | |||
438 | #endif /* __PERF_EVSEL_H */ | 440 | #endif /* __PERF_EVSEL_H */ |