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

Commit e21ded5e 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:

  * Don't try to find DSOs in SYSV maps (Don Zickus)

  * Fallback to MAP__FUNCTION if daddr maps are NULL,
    i.e. addresses get looked upon more maps (Don Zickus)

  * Kernel fix to properly handle exited tasks, by returning POLLHUP values
    on perf event file descriptors. Tooling changes will come next, but were
    tested with this kernel fix. (Jiri Olsa)

  * Add +field argument support for --field option, so that one can add
    fields to the default list of fields to show, i.e. now one can just do:

     perf report --fields +pid

    And the pid will appear in addition to the default fields. (Jiri Olsa)

Infrastructure changes:

  * More Intel PT prep stuff, including:
    - Add a 'perf test' for tracking with sched_switch
    - Add 'flush' callback to scripting API

  * hists browser (used in top and report) refactorings, getting rid of unused
    variables and reducing source code size by handling similar cases in a
    fewer functions (Namhyung Kim).

  * Explicitly include util/debug.h for powerpc, was being indirectly included,
    broke the build when some change made it stop being included. (Sukadev
    Bhattiprolu)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents af924aa3 39ee533f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -269,6 +269,7 @@ struct pmu {
 * enum perf_event_active_state - the states of a event
 */
enum perf_event_active_state {
	PERF_EVENT_STATE_EXIT		= -3,
	PERF_EVENT_STATE_ERROR		= -2,
	PERF_EVENT_STATE_OFF		= -1,
	PERF_EVENT_STATE_INACTIVE	=  0,
+10 −2
Original line number Diff line number Diff line
@@ -3600,7 +3600,8 @@ perf_read_hw(struct perf_event *event, char __user *buf, size_t count)
	 * error state (i.e. because it was pinned but it couldn't be
	 * scheduled on to the CPU at some point).
	 */
	if (event->state == PERF_EVENT_STATE_ERROR)
	if ((event->state == PERF_EVENT_STATE_ERROR) ||
	    (event->state == PERF_EVENT_STATE_EXIT))
		return 0;

	if (count < event->read_size)
@@ -3627,9 +3628,13 @@ static unsigned int perf_poll(struct file *file, poll_table *wait)
{
	struct perf_event *event = file->private_data;
	struct ring_buffer *rb;
	unsigned int events = POLL_HUP;
	unsigned int events = POLLHUP;

	poll_wait(file, &event->waitq, wait);

	if (event->state == PERF_EVENT_STATE_EXIT)
		return events;

	/*
	 * Pin the event->rb by taking event->mmap_mutex; otherwise
	 * perf_event_set_output() can swizzle our rb and make us miss wakeups.
@@ -7588,6 +7593,9 @@ __perf_event_exit_task(struct perf_event *child_event,
	if (child_event->parent) {
		sync_child_event(child_event, child);
		free_event(child_event);
	} else {
		child_event->state = PERF_EVENT_STATE_EXIT;
		perf_event_wakeup(child_event);
	}
}

+1 −0
Original line number Diff line number Diff line
@@ -425,6 +425,7 @@ endif
endif
LIB_OBJS += $(OUTPUT)tests/mmap-thread-lookup.o
LIB_OBJS += $(OUTPUT)tests/thread-mg-share.o
LIB_OBJS += $(OUTPUT)tests/switch-tracking.o

BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@

#include "util/thread.h"
#include "util/callchain.h"
#include "util/debug.h"

/*
 * When saving the callchain on Power, the kernel conservatively saves
+13 −0
Original line number Diff line number Diff line
@@ -485,6 +485,11 @@ static int default_start_script(const char *script __maybe_unused,
	return 0;
}

static int default_flush_script(void)
{
	return 0;
}

static int default_stop_script(void)
{
	return 0;
@@ -498,6 +503,7 @@ static int default_generate_script(struct pevent *pevent __maybe_unused,

static struct scripting_ops default_scripting_ops = {
	.start_script		= default_start_script,
	.flush_script		= default_flush_script,
	.stop_script		= default_stop_script,
	.process_event		= process_event,
	.generate_script	= default_generate_script,
@@ -513,6 +519,11 @@ static void setup_scripting(void)
	scripting_ops = &default_scripting_ops;
}

static int flush_scripting(void)
{
	return scripting_ops->flush_script();
}

static int cleanup_scripting(void)
{
	pr_debug("\nperf script stopped\n");
@@ -1813,6 +1824,8 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)

	err = __cmd_script(&script);

	flush_scripting();

out_delete:
	perf_session__delete(session);

Loading