diff options
-rw-r--r-- | tools/perf/util/dso.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index e059976d9d93..cb6199c1390a 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c @@ -898,18 +898,12 @@ static ssize_t cached_read(struct dso *dso, struct machine *machine, return r; } -int dso__data_file_size(struct dso *dso, struct machine *machine) +static int file_size(struct dso *dso, struct machine *machine) { int ret = 0; struct stat st; char sbuf[STRERR_BUFSIZE]; - if (dso->data.file_size) - return 0; - - if (dso->data.status == DSO_DATA_STATUS_ERROR) - return -1; - pthread_mutex_lock(&dso__data_open_lock); /* @@ -938,6 +932,17 @@ out: return ret; } +int dso__data_file_size(struct dso *dso, struct machine *machine) +{ + if (dso->data.file_size) + return 0; + + if (dso->data.status == DSO_DATA_STATUS_ERROR) + return -1; + + return file_size(dso, machine); +} + /** * dso__data_size - Return dso data size * @dso: dso object |