diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2014-07-22 16:17:19 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-07-23 11:23:44 -0300 |
commit | 288be943b5024729cd6809b61b62f727960178f3 (patch) | |
tree | ac7ec9cebe169d8305059b0d2135680afd4f9f92 /tools/perf/util/dso.c | |
parent | c27697d6dee02ef2389b6701c792a075bc9873dc (diff) | |
download | lwn-288be943b5024729cd6809b61b62f727960178f3.tar.gz lwn-288be943b5024729cd6809b61b62f727960178f3.zip |
perf tools: Add dso__data_status_seen()
Add a function to track whether a caller has seen the data status of a
dso. This is needed to enable callers to report the error exactly once
only per dso.
Signed-off-by: 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: 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/r/1406035081-14301-11-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/dso.c')
-rw-r--r-- | tools/perf/util/dso.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index 8827db3d2cba..84e4a0546a31 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c @@ -359,6 +359,18 @@ out: return dso->data.fd; } +bool dso__data_status_seen(struct dso *dso, enum dso_data_status_seen by) +{ + u32 flag = 1 << by; + + if (dso->data.status_seen & flag) + return true; + + dso->data.status_seen |= flag; + + return false; +} + static void dso_cache__free(struct rb_root *root) { |