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, | |||
| 898 | return r; | 898 | return r; |
| 899 | } | 899 | } |
| 900 | 900 | ||
| 901 | int dso__data_file_size(struct dso *dso, struct machine *machine) | 901 | static int file_size(struct dso *dso, struct machine *machine) |
| 902 | { | 902 | { |
| 903 | int ret = 0; | 903 | int ret = 0; |
| 904 | struct stat st; | 904 | struct stat st; |
| 905 | char sbuf[STRERR_BUFSIZE]; | 905 | char sbuf[STRERR_BUFSIZE]; |
| 906 | 906 | ||
| 907 | if (dso->data.file_size) | ||
| 908 | return 0; | ||
| 909 | |||
| 910 | if (dso->data.status == DSO_DATA_STATUS_ERROR) | ||
| 911 | return -1; | ||
| 912 | |||
| 913 | pthread_mutex_lock(&dso__data_open_lock); | 907 | pthread_mutex_lock(&dso__data_open_lock); |
| 914 | 908 | ||
| 915 | /* | 909 | /* |
| @@ -938,6 +932,17 @@ out: | |||
| 938 | return ret; | 932 | return ret; |
| 939 | } | 933 | } |
| 940 | 934 | ||
| 935 | int dso__data_file_size(struct dso *dso, struct machine *machine) | ||
| 936 | { | ||
| 937 | if (dso->data.file_size) | ||
| 938 | return 0; | ||
| 939 | |||
| 940 | if (dso->data.status == DSO_DATA_STATUS_ERROR) | ||
| 941 | return -1; | ||
| 942 | |||
| 943 | return file_size(dso, machine); | ||
| 944 | } | ||
| 945 | |||
| 941 | /** | 946 | /** |
| 942 | * dso__data_size - Return dso data size | 947 | * dso__data_size - Return dso data size |
| 943 | * @dso: dso object | 948 | * @dso: dso object |
