lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cd132d6b-89ec-1408-f4da-44020e13d4b2@linux.intel.com>
Date:   Mon, 6 Jul 2020 16:05:48 +0300
From:   Alexey Budankov <alexey.budankov@...ux.intel.com>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Andi Kleen <ak@...ux.intel.com>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v9 02/15] tools/libperf: add properties to struct pollfd
 *entries objects


On 06.07.2020 15:24, Jiri Olsa wrote:
> On Fri, Jul 03, 2020 at 10:41:45AM +0300, Alexey Budankov wrote:
>>
>> Store boolean properties per struct pollfd *entries object in a
>> bitmap of int size. Implement fdarray_prop__nonfilterable property
>> to skip object from counting by fdarray_filter().
> 
> ok, I think can do it like this, few comments below
> 
> thanks,
> jirka
> 
>>
>> Signed-off-by: Alexey Budankov <alexey.budankov@...ux.intel.com>
>> ---
>>  tools/lib/api/fd/array.c                 | 17 +++++++++--------
>>  tools/lib/api/fd/array.h                 | 18 +++++++++++++-----
>>  tools/lib/perf/evlist.c                  | 10 +++++-----
>>  tools/lib/perf/include/internal/evlist.h |  2 +-
>>  tools/perf/tests/fdarray.c               |  2 +-
>>  tools/perf/util/evlist.c                 |  2 +-
>>  6 files changed, 30 insertions(+), 21 deletions(-)

<SNIP>

>>
>> diff --git a/tools/lib/api/fd/array.h b/tools/lib/api/fd/array.h
>> index b39557d1a88f..19b6a34aeea5 100644
>> --- a/tools/lib/api/fd/array.h
>> +++ b/tools/lib/api/fd/array.h
>> @@ -21,10 +21,18 @@ struct fdarray {
>>  	int	       nr_alloc;
>>  	int	       nr_autogrow;
>>  	struct pollfd *entries;
>> -	union {
>> -		int    idx;
>> -		void   *ptr;
>> -	} *priv;
>> +	struct {
>> +		union {
>> +			int    idx;
>> +			void   *ptr;
>> +		} priv;
>> +		int bits;
>> +	} *prop;
>> +};
> 
> why not keeping the 'priv' as a struct, like:
> 
> 	struct {
> 		union {
> 			int    idx;
> 			void   *ptr;
> 		};
> 		unsigned int flags;
> 	} *priv;
> 
> I think we would have much less changes, also please rename bits
> to flags and use some unsigned type for that

Well, I supposed that priv is short for private what means the layout
of struct priv object is opaque to fdarray implementation and it just
passes the object as a void pointer to external callbacks (e.g in __filter()).
So I preserved this semantics and wrapped and extended priv object
with with flags field. It can be implemented with struct priv if you like.

> 
>> +
>> +enum fdarray_props {
>> +	fdarray_prop__default	    = 0x00000000,
>> +	fdarray_prop__nonfilterable = 0x00000001
>>  };
> 
> s/fdarray_props/fdarray_flag/

Accepted.

Alexey

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ