Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41d279aa authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge tag 'perf-core-for-mingo' of...

Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

 into perf/core

Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

User visible changes:

  - Force period term to overload global settings, i.e. previously this
    command line:

     $ perf record -e 'cpu/instructions,period=20000/',cycles -c 1000 sleep 1

    would result in both events having a period equal to 1000, with the fix we
    get something saner:

     $ perf evlist -v | grep period
     cpu/instructions,period=20000/: ... { sample_period, sample_freq }: 20000, ...
     cycles: ... { sample_period, sample_freq }: 1000 ...
     $

   (Jiri Olsa)

Infrastructure changes:

  - Use the dummy software event with freq=0 in the twatch.py python
    binding example, to avoid disabling nohz. (Arnaldo Carvalho de Melo)

  - Add some missing constants to the python binding. (Arnaldo Carvalho de Melo)

  - Fix mismatched declarations for elf_getphdrnum, that happens
    only in the corner case where this function is not found on
    the system.  (Arnaldo Carvalho de Melo)

  - Add build test for having ending double slash. (Jiri Olsa)

  - Introduce callgraph_set for callgraph option. (Kan Liang)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents acd632eb aa53c09e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -46,7 +46,7 @@ OPTIONS
          /sys/bus/event_sources/devices/<pmu>/format/*
          /sys/bus/event_sources/devices/<pmu>/format/*


	  There are also some params which are not defined in .../<pmu>/format/*.
	  There are also some params which are not defined in .../<pmu>/format/*.
	  These params can be used to set event defaults.
	  These params can be used to overload default config values per event.
	  Here is a list of the params.
	  Here is a list of the params.
	  - 'period': Set event sampling period
	  - 'period': Set event sampling period


+7 −2
Original line number Original line Diff line number Diff line
@@ -762,12 +762,14 @@ static void callchain_debug(void)
			 callchain_param.dump_size);
			 callchain_param.dump_size);
}
}


int record_parse_callchain_opt(const struct option *opt __maybe_unused,
int record_parse_callchain_opt(const struct option *opt,
			       const char *arg,
			       const char *arg,
			       int unset)
			       int unset)
{
{
	int ret;
	int ret;
	struct record_opts *record = (struct record_opts *)opt->value;


	record->callgraph_set = true;
	callchain_param.enabled = !unset;
	callchain_param.enabled = !unset;


	/* --no-call-graph */
	/* --no-call-graph */
@@ -784,10 +786,13 @@ int record_parse_callchain_opt(const struct option *opt __maybe_unused,
	return ret;
	return ret;
}
}


int record_callchain_opt(const struct option *opt __maybe_unused,
int record_callchain_opt(const struct option *opt,
			 const char *arg __maybe_unused,
			 const char *arg __maybe_unused,
			 int unset __maybe_unused)
			 int unset __maybe_unused)
{
{
	struct record_opts *record = (struct record_opts *)opt->value;

	record->callgraph_set = true;
	callchain_param.enabled = true;
	callchain_param.enabled = true;


	if (callchain_param.record_mode == CALLCHAIN_NONE)
	if (callchain_param.record_mode == CALLCHAIN_NONE)
+1 −1
Original line number Original line Diff line number Diff line
@@ -1489,7 +1489,7 @@ static int trace__symbols_init(struct trace *trace, struct perf_evlist *evlist)
	if (trace->host == NULL)
	if (trace->host == NULL)
		return -ENOMEM;
		return -ENOMEM;


	if (trace_event__register_resolver(trace->host) < 0)
	if (trace_event__register_resolver(trace->host, machine__resolve_kernel_addr) < 0)
		return -errno;
		return -errno;


	err = __machine__synthesize_threads(trace->host, &trace->tool, &trace->opts.target,
	err = __machine__synthesize_threads(trace->host, &trace->tool, &trace->opts.target,
+1 −0
Original line number Original line Diff line number Diff line
@@ -52,6 +52,7 @@ struct record_opts {
	bool	     sample_weight;
	bool	     sample_weight;
	bool	     sample_time;
	bool	     sample_time;
	bool	     sample_time_set;
	bool	     sample_time_set;
	bool	     callgraph_set;
	bool	     period;
	bool	     period;
	bool	     sample_intr_regs;
	bool	     sample_intr_regs;
	bool	     running_time;
	bool	     running_time;
+11 −1
Original line number Original line Diff line number Diff line
@@ -18,10 +18,20 @@ import perf
def main():
def main():
	cpus = perf.cpu_map()
	cpus = perf.cpu_map()
	threads = perf.thread_map()
	threads = perf.thread_map()
	evsel = perf.evsel(task = 1, comm = 1, mmap = 0,
	evsel = perf.evsel(type	  = perf.TYPE_SOFTWARE,
			   config = perf.COUNT_SW_DUMMY,
			   task = 1, comm = 1, mmap = 0, freq = 0,
			   wakeup_events = 1, watermark = 1,
			   wakeup_events = 1, watermark = 1,
			   sample_id_all = 1,
			   sample_id_all = 1,
			   sample_type = perf.SAMPLE_PERIOD | perf.SAMPLE_TID | perf.SAMPLE_CPU)
			   sample_type = perf.SAMPLE_PERIOD | perf.SAMPLE_TID | perf.SAMPLE_CPU)

	"""What we want are just the PERF_RECORD_ lifetime events for threads,
	 using the default, PERF_TYPE_HARDWARE + PERF_COUNT_HW_CYCLES & freq=1
	 (the default), makes perf reenable irq_vectors:local_timer_entry, when
	 disabling nohz, not good for some use cases where all we want is to get
	 threads comes and goes... So use (perf.TYPE_SOFTWARE, perf_COUNT_SW_DUMMY,
	 freq=0) instead."""

	evsel.open(cpus = cpus, threads = threads);
	evsel.open(cpus = cpus, threads = threads);
	evlist = perf.evlist(cpus, threads)
	evlist = perf.evlist(cpus, threads)
	evlist.add(evsel)
	evlist.add(evsel)
Loading