All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: "Bayduraev, Alexey V" <alexey.v.bayduraev@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Andi Kleen <ak@linux.intel.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Alexei Budankov <abudankov@huawei.com>,
	Alexander Antonov <alexander.antonov@linux.intel.com>
Subject: Re: [PATCH v4 08/12] perf record: introduce --threads=<spec> command line option
Date: Thu, 8 Apr 2021 23:52:33 +0200	[thread overview]
Message-ID: <YG97Id/zNgdFLeWr@krava> (raw)
In-Reply-To: <ad2c112c-d6ae-c7cf-4fa7-a07279df4388@linux.intel.com>

On Tue, Apr 06, 2021 at 11:49:06AM +0300, Bayduraev, Alexey V wrote:

SNIP

> Suggested-by: Jiri Olsa <jolsa@kernel.org>
> Suggested-by: Namhyung Kim <namhyung@kernel.org>
> Signed-off-by: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
> ---
>  tools/include/linux/bitmap.h |  11 ++
>  tools/lib/bitmap.c           |  14 ++
>  tools/perf/builtin-record.c  | 317 ++++++++++++++++++++++++++++++++++-
>  tools/perf/util/record.h     |   1 +
>  4 files changed, 341 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/include/linux/bitmap.h b/tools/include/linux/bitmap.h
> index 477a1cae513f..2eb1d1084543 100644
> --- a/tools/include/linux/bitmap.h
> +++ b/tools/include/linux/bitmap.h
> @@ -18,6 +18,8 @@ int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
>  int __bitmap_equal(const unsigned long *bitmap1,
>  		   const unsigned long *bitmap2, unsigned int bits);
>  void bitmap_clear(unsigned long *map, unsigned int start, int len);
> +int __bitmap_intersects(const unsigned long *bitmap1,
> +			const unsigned long *bitmap2, unsigned int bits);
>  
>  #define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) & (BITS_PER_LONG - 1)))
>  
> @@ -178,4 +180,13 @@ static inline int bitmap_equal(const unsigned long *src1,
>  	return __bitmap_equal(src1, src2, nbits);
>  }
>  
> +static inline int bitmap_intersects(const unsigned long *src1,
> +			const unsigned long *src2, unsigned int nbits)
> +{
> +	if (small_const_nbits(nbits))
> +		return ((*src1 & *src2) & BITMAP_LAST_WORD_MASK(nbits)) != 0;
> +	else
> +		return __bitmap_intersects(src1, src2, nbits);
> +}
> +
>  #endif /* _PERF_BITOPS_H */
> diff --git a/tools/lib/bitmap.c b/tools/lib/bitmap.c
> index 5043747ef6c5..3cc3a5b43bb5 100644
> --- a/tools/lib/bitmap.c
> +++ b/tools/lib/bitmap.c
> @@ -86,3 +86,17 @@ int __bitmap_equal(const unsigned long *bitmap1,
>  
>  	return 1;
>  }
> +
> +int __bitmap_intersects(const unsigned long *bitmap1,
> +			const unsigned long *bitmap2, unsigned int bits)
> +{
> +	unsigned int k, lim = bits/BITS_PER_LONG;
> +	for (k = 0; k < lim; ++k)
> +		if (bitmap1[k] & bitmap2[k])
> +			return 1;
> +
> +	if (bits % BITS_PER_LONG)
> +		if ((bitmap1[k] & bitmap2[k]) & BITMAP_LAST_WORD_MASK(bits))
> +			return 1;
> +	return 0;
> +}

please move __bitmap_intersects function to the separate patch

jirka


  reply	other threads:[~2021-04-08 21:52 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06  8:37 [PATCH v4 00/12] Introduce threaded trace streaming for basic perf record operation Bayduraev, Alexey V
2021-04-06  8:38 ` [PATCH v4 01/12] perf record: introduce thread affinity and mmap masks Bayduraev, Alexey V
2021-04-06  8:39 ` [PATCH v4 02/12] perf record: introduce thread specific data array Bayduraev, Alexey V
2021-04-08 14:16   ` Andi Kleen
2021-04-09  7:06     ` Bayduraev, Alexey V
2021-04-06  8:40 ` [PATCH v4 03/12] perf record: introduce thread local variable Bayduraev, Alexey V
2021-04-06  8:44 ` [PATCH v4 04/12] perf record: stop threads in the end of trace streaming Bayduraev, Alexey V
2021-04-06  8:45 ` [PATCH v4 05/12] perf record: start threads in the beginning " Bayduraev, Alexey V
2021-04-08 14:21   ` Andi Kleen
2021-04-06  8:47 ` [PATCH v4 06/12] perf record: introduce data file at mmap buffer object Bayduraev, Alexey V
2021-04-08 21:52   ` Jiri Olsa
2021-04-06  8:48 ` [PATCH v4 07/12] perf record: init " Bayduraev, Alexey V
2021-04-06  8:49 ` [PATCH v4 08/12] perf record: introduce --threads=<spec> command line option Bayduraev, Alexey V
2021-04-08 21:52   ` Jiri Olsa [this message]
2021-04-13  1:02   ` Namhyung Kim
2021-04-06  8:49 ` [PATCH v4 09/12] perf record: document parallel data streaming mode Bayduraev, Alexey V
2021-04-08 14:25   ` Andi Kleen
2021-04-06  8:51 ` [PATCH v4 10/12] perf report: output data file name in raw trace dump Bayduraev, Alexey V
2021-04-06  8:52 ` [PATCH v4 11/12] perf session: load data directory files for analysis Bayduraev, Alexey V
2021-04-08 21:52   ` Jiri Olsa
2021-04-06  8:53 ` [PATCH v4 12/12] perf session: use reader functions to load perf data file Bayduraev, Alexey V
2021-04-08 14:26   ` Andi Kleen
2021-04-08 21:52 ` [PATCH v4 00/12] Introduce threaded trace streaming for basic perf record operation Jiri Olsa
2021-04-09 10:51   ` Bayduraev, Alexey V

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YG97Id/zNgdFLeWr@krava \
    --to=jolsa@redhat.com \
    --cc=abudankov@huawei.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.antonov@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexey.v.bayduraev@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.