diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-07-07 10:51:47 -0400 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-07-12 14:19:59 -0400 |
| commit | 5496bc0c0d255f2a8a3a4c36087eb3b72ff63ea0 (patch) | |
| tree | bc98ad49f172151f68d47b71368eb8c4f2309fc8 | |
| parent | 175729fc2c5144e9eee06b3483c5c9798f7062a5 (diff) | |
perf evsel: Uninline the is_function_event method
So that we don't have to carry a string.h header in evsel.h
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-2lwpm2aytdvvgo626zuat6et@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
| -rw-r--r-- | tools/perf/util/evsel.c | 18 | ||||
| -rw-r--r-- | tools/perf/util/evsel.h | 18 |
2 files changed, 19 insertions, 17 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index d8c2298cd32a..ba0f59fa3d5d 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
| @@ -200,6 +200,24 @@ void perf_evsel__set_sample_id(struct perf_evsel *evsel, | |||
| 200 | evsel->attr.read_format |= PERF_FORMAT_ID; | 200 | evsel->attr.read_format |= PERF_FORMAT_ID; |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | /** | ||
| 204 | * perf_evsel__is_function_event - Return whether given evsel is a function | ||
| 205 | * trace event | ||
| 206 | * | ||
| 207 | * @evsel - evsel selector to be tested | ||
| 208 | * | ||
| 209 | * Return %true if event is function trace event | ||
| 210 | */ | ||
| 211 | bool perf_evsel__is_function_event(struct perf_evsel *evsel) | ||
| 212 | { | ||
| 213 | #define FUNCTION_EVENT "ftrace:function" | ||
| 214 | |||
| 215 | return evsel->name && | ||
| 216 | !strncmp(FUNCTION_EVENT, evsel->name, sizeof(FUNCTION_EVENT)); | ||
| 217 | |||
| 218 | #undef FUNCTION_EVENT | ||
| 219 | } | ||
| 220 | |||
| 203 | void perf_evsel__init(struct perf_evsel *evsel, | 221 | void perf_evsel__init(struct perf_evsel *evsel, |
| 204 | struct perf_event_attr *attr, int idx) | 222 | struct perf_event_attr *attr, int idx) |
| 205 | { | 223 | { |
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 86fed7a2932b..d73391e8740e 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h | |||
| @@ -355,23 +355,7 @@ static inline bool perf_evsel__is_group_event(struct perf_evsel *evsel) | |||
| 355 | return perf_evsel__is_group_leader(evsel) && evsel->nr_members > 1; | 355 | return perf_evsel__is_group_leader(evsel) && evsel->nr_members > 1; |
| 356 | } | 356 | } |
| 357 | 357 | ||
| 358 | /** | 358 | bool perf_evsel__is_function_event(struct perf_evsel *evsel); |
| 359 | * perf_evsel__is_function_event - Return whether given evsel is a function | ||
| 360 | * trace event | ||
| 361 | * | ||
| 362 | * @evsel - evsel selector to be tested | ||
| 363 | * | ||
| 364 | * Return %true if event is function trace event | ||
| 365 | */ | ||
| 366 | static inline bool perf_evsel__is_function_event(struct perf_evsel *evsel) | ||
| 367 | { | ||
| 368 | #define FUNCTION_EVENT "ftrace:function" | ||
| 369 | |||
| 370 | return evsel->name && | ||
| 371 | !strncmp(FUNCTION_EVENT, evsel->name, sizeof(FUNCTION_EVENT)); | ||
| 372 | |||
| 373 | #undef FUNCTION_EVENT | ||
| 374 | } | ||
| 375 | 359 | ||
| 376 | static inline bool perf_evsel__is_bpf_output(struct perf_evsel *evsel) | 360 | static inline bool perf_evsel__is_bpf_output(struct perf_evsel *evsel) |
| 377 | { | 361 | { |
