lkml.org 
[lkml]   [2014]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V3] perf tools: Record whether a dso has data
On 07/22/2014 10:55 AM, Jiri Olsa wrote:
> On Thu, Jul 17, 2014 at 11:58:30AM +0300, Adrian Hunter wrote:
>> Add 'data_status' to record whether a dso has data
>> (i.e. an object file)
>
> I might have seen it in your last patsent, but forgot.. what is
> this data_status going to be used for?

I have changed it a bit in the latest posting. It was originally
for two purposes:
1. to prevent repeatedly attempting to open a file that
was not there (very time consuming if you do it millions of times)
2. to report the error exactly once

But I realized it did not meet the 2nd objective so I have added
another patch that does. See "perf tools: Add dso__data_status_seen()"

>
> SNIP
>
>> diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
>> index c239e86..07d0a58 100644
>> --- a/tools/perf/util/dso.h
>> +++ b/tools/perf/util/dso.h
>> @@ -40,6 +40,12 @@ enum dso_swap_type {
>> DSO_SWAP__YES,
>> };
>>
>> +enum dso_data_status {
>> + DSO_DATA_STATUS_ERROR = -1,
>> + DSO_DATA_STATUS_UNKNOWN = 0,
>> + DSO_DATA_STATUS_OK = 1,
>> +};
>> +
>> #define DSO__SWAP(dso, type, val) \
>> ({ \
>> type ____r = val; \
>> @@ -104,6 +110,7 @@ struct dso {
>> struct {
>> struct rb_root cache;
>> int fd;
>> + int data_status;
>
> also please call it just 'status' it's already in 'data' struct

I made that change too.




\
 
 \ /
  Last update: 2014-07-22 20:41    [W:0.091 / U:1.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site