aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/util.h
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2012-04-26 01:15:18 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-05-02 14:22:08 -0400
commit4bd0f2d2c0cf14de9c84c2fe689120c6b0f667c8 (patch)
treed663fdacac1c3d0dd2c75f939fddbe63d2aa86ba /tools/perf/util/util.h
parentfe9d18a71d2018f8021fd2bd2aaf5137954ef839 (diff)
perf tools: Introduce perf_target__validate() helper
The perf_target__validate function is used to check given PID/TID/UID/CPU target options and warn if some combination is impossible. Also this can make some arguments of parse_target_uid() function useless as it is checked before the call via our new helper. Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Reviewed-by: David Ahern <dsahern@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1335417327-11796-5-git-send-email-namhyung.kim@lge.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/util.h')
-rw-r--r--tools/perf/util/util.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 0f99f394d8e0..3f05d6264dab 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -246,10 +246,12 @@ unsigned long convert_unit(unsigned long value, char *unit);
246int readn(int fd, void *buf, size_t size); 246int readn(int fd, void *buf, size_t size);
247 247
248struct perf_event_attr; 248struct perf_event_attr;
249struct perf_target;
249 250
250void event_attr_init(struct perf_event_attr *attr); 251void event_attr_init(struct perf_event_attr *attr);
251 252
252uid_t parse_target_uid(const char *str, const char *tid, const char *pid); 253uid_t parse_target_uid(const char *str);
254void perf_target__validate(struct perf_target *target);
253 255
254#define _STR(x) #x 256#define _STR(x) #x
255#define STR(x) _STR(x) 257#define STR(x) _STR(x)