All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Budankov <alexey.budankov@linux.intel.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Andi Kleen <ak@linux.intel.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 4/4] perf record: implement --affinity=node|cpu option
Date: Wed, 9 Jan 2019 12:15:19 +0300	[thread overview]
Message-ID: <58fb01b1-a522-3d2f-58fd-aaa975a49d84@linux.intel.com> (raw)
In-Reply-To: <20190101213918.GC13760@krava>

Hi,

On 02.01.2019 0:39, Jiri Olsa wrote:
> On Mon, Dec 24, 2018 at 03:28:33PM +0300, Alexey Budankov wrote:
>>
>> Implement --affinity=node|cpu option for the record mode defaulting
>> to system affinity mask bouncing.
>>
>> Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
>> ---
>>  tools/perf/Documentation/perf-record.txt |  5 +++++
>>  tools/perf/builtin-record.c              | 18 ++++++++++++++++++
>>  2 files changed, 23 insertions(+)
>>
>> diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
>> index d232b13ea713..efb839784f32 100644
>> --- a/tools/perf/Documentation/perf-record.txt
>> +++ b/tools/perf/Documentation/perf-record.txt
>> @@ -440,6 +440,11 @@ Use <n> control blocks in asynchronous (Posix AIO) trace writing mode (default:
>>  Asynchronous mode is supported only when linking Perf tool with libc library
>>  providing implementation for Posix AIO API.
>>  
>> +--affinity=mode::
>> +Set affinity mask of trace reading thread according to the policy defined by 'mode' value:
>> +  node - thread affinity mask is set to NUMA node cpu mask of the processed mmap buffer
>> +  cpu  - thread affinity mask is set to cpu of the processed mmap buffer
>> +
>>  --all-kernel::
>>  Configure all used events to run in kernel space.
>>  
>> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
>> index eea96794ee45..57dc3a45d16f 100644
>> --- a/tools/perf/builtin-record.c
>> +++ b/tools/perf/builtin-record.c
>> @@ -1653,6 +1653,21 @@ static int parse_clockid(const struct option *opt, const char *str, int unset)
>>  	ui__warning("unknown clockid %s, check man page\n", ostr);
>>  	return -1;
>>  }
>> +static int record__parse_affinity(const struct option *opt, const char *str, int unset)
>> +{
>> +	struct record_opts *opts = (struct record_opts *)opt->value;
>> +
>> +	if (!unset) {
>> +		if (str) {
>> +			if (!strcasecmp(str, "node"))
>> +				opts->affinity = PERF_AFFINITY_NODE;
>> +			else if (!strcasecmp(str, "cpu"))
>> +				opts->affinity = PERF_AFFINITY_CPU;
>> +		}
>> +	}
>> +
>> +	return 0;
>> +}
>>  
>>  static int record__parse_mmap_pages(const struct option *opt,
>>  				    const char *str,
>> @@ -1961,6 +1976,9 @@ static struct option __record_options[] = {
>>  		     &nr_cblocks_default, "n", "Use <n> control blocks in asynchronous trace writing mode (default: 1, max: 4)",
>>  		     record__aio_parse),
>>  #endif
>> +	OPT_CALLBACK(0, "affinity", &record.opts, "node|cpu",
>> +		     "Set affinity mask of trace reading thread to NUMA node cpu mask or cpu of processed mmap buffer",
>> +		     record__parse_affinity),
> 
> so this makes sense only when there's --aio and LIBNUMA
> in place.. we should check for those and allow this only
> for these

Serial trace streaming also benefits from that.

Thanks,
Alexey

> 
> jirka
> 

  reply	other threads:[~2019-01-09  9:15 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-24 12:11 [PATCH v2 0/4] Reduce NUMA related overhead in perf record profiling on large server systems Alexey Budankov
2018-12-24 12:23 ` [PATCH v2 1/4] perf record: allocate affinity masks Alexey Budankov
2019-01-01 21:39   ` Jiri Olsa
2019-01-09  9:10     ` Alexey Budankov
2018-12-24 12:24 ` [PATCH v2 2/4] perf record: bind the AIO user space buffers to nodes Alexey Budankov
2019-01-01 21:39   ` Jiri Olsa
2019-01-09  9:10     ` Alexey Budankov
2019-01-01 21:39   ` Jiri Olsa
2019-01-09  9:10     ` Alexey Budankov
2019-01-01 21:41   ` Jiri Olsa
2019-01-09  9:12     ` Alexey Budankov
2019-01-09 16:49       ` Jiri Olsa
2019-01-09 18:14         ` Alexey Budankov
2018-12-24 12:27 ` [PATCH v2 3/4] perf record: apply affinity masks when reading mmap buffers Alexey Budankov
2019-01-01 21:39   ` Jiri Olsa
2019-01-09  9:13     ` Alexey Budankov
2019-01-01 21:39   ` Jiri Olsa
2019-01-09  9:14     ` Alexey Budankov
2018-12-24 12:28 ` [PATCH v2 4/4] perf record: implement --affinity=node|cpu option Alexey Budankov
2019-01-01 21:39   ` Jiri Olsa
2019-01-09  9:15     ` Alexey Budankov [this message]
2019-01-01 21:39   ` Jiri Olsa
2019-01-09  9:15     ` Alexey Budankov
2019-01-09  9:15     ` Alexey Budankov
  -- strict thread matches above, loose matches on Subject: below --
2018-12-13  7:07 [PATCH v2 0/4] Reduce NUMA related overhead in perf record profiling on large server systems Alexey Budankov
2018-12-13  7:20 ` [PATCH v2 4/4] perf record: implement --affinity=node|cpu option Alexey Budankov

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=58fb01b1-a522-3d2f-58fd-aaa975a49d84@linux.intel.com \
    --to=alexey.budankov@linux.intel.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.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.