mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]> Cc: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
c27697d6de
commit
288be943b5
2 changed files with 18 additions and 0 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -46,6 +46,10 @@ enum dso_data_status {
|
|||
DSO_DATA_STATUS_OK = 1,
|
||||
};
|
||||
|
||||
enum dso_data_status_seen {
|
||||
DSO_DATA_STATUS_SEEN_ITRACE,
|
||||
};
|
||||
|
||||
#define DSO__SWAP(dso, type, val) \
|
||||
({ \
|
||||
type ____r = val; \
|
||||
|
|
@ -111,6 +115,7 @@ struct dso {
|
|||
struct rb_root cache;
|
||||
int fd;
|
||||
int status;
|
||||
u32 status_seen;
|
||||
size_t file_size;
|
||||
struct list_head open_entry;
|
||||
} data;
|
||||
|
|
@ -203,6 +208,7 @@ ssize_t dso__data_read_offset(struct dso *dso, struct machine *machine,
|
|||
ssize_t dso__data_read_addr(struct dso *dso, struct map *map,
|
||||
struct machine *machine, u64 addr,
|
||||
u8 *data, ssize_t size);
|
||||
bool dso__data_status_seen(struct dso *dso, enum dso_data_status_seen by);
|
||||
|
||||
struct map *dso__new_map(const char *name);
|
||||
struct dso *dso__kernel_findnew(struct machine *machine, const char *name,
|
||||
|
|
|
|||
Loading…
Reference in a new issue