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

Commit e3f42609 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo
Browse files

perf tools: Use evsel->attr.sample_type instead of session->sample_type

Eventually session->sample_type will go away as we want to support
multiple sample types per session, so use it from the evsel which is a
step in that direction.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-0vwdpjcwbjezw459lw5n3ew1@git.kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 246d4ce8
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -3,6 +3,7 @@


#include "util/util.h"
#include "util/util.h"
#include "util/cache.h"
#include "util/cache.h"
#include "util/evsel.h"
#include "util/symbol.h"
#include "util/symbol.h"
#include "util/thread.h"
#include "util/thread.h"
#include "util/header.h"
#include "util/header.h"
@@ -1603,12 +1604,12 @@ static void process_raw_event(union perf_event *raw_event __used,


static int process_sample_event(union perf_event *event,
static int process_sample_event(union perf_event *event,
				struct perf_sample *sample,
				struct perf_sample *sample,
				struct perf_evsel *evsel __used,
				struct perf_evsel *evsel,
				struct perf_session *session)
				struct perf_session *session)
{
{
	struct thread *thread;
	struct thread *thread;


	if (!(session->sample_type & PERF_SAMPLE_RAW))
	if (!(evsel->attr.sample_type & PERF_SAMPLE_RAW))
		return 0;
		return 0;


	thread = perf_session__findnew(session, sample->pid);
	thread = perf_session__findnew(session, sample->pid);
+5 −4
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@
#include "util/color.h"
#include "util/color.h"
#include <linux/list.h>
#include <linux/list.h>
#include "util/cache.h"
#include "util/cache.h"
#include "util/evsel.h"
#include <linux/rbtree.h>
#include <linux/rbtree.h>
#include "util/symbol.h"
#include "util/symbol.h"
#include "util/callchain.h"
#include "util/callchain.h"
@@ -488,12 +489,12 @@ static void sched_switch(int cpu, u64 timestamp, struct trace_entry *te)


static int process_sample_event(union perf_event *event __used,
static int process_sample_event(union perf_event *event __used,
				struct perf_sample *sample,
				struct perf_sample *sample,
				struct perf_evsel *evsel __used,
				struct perf_evsel *evsel,
				struct perf_session *session)
				struct perf_session *session __used)
{
{
	struct trace_entry *te;
	struct trace_entry *te;


	if (session->sample_type & PERF_SAMPLE_TIME) {
	if (evsel->attr.sample_type & PERF_SAMPLE_TIME) {
		if (!first_time || first_time > sample->time)
		if (!first_time || first_time > sample->time)
			first_time = sample->time;
			first_time = sample->time;
		if (last_time < sample->time)
		if (last_time < sample->time)
@@ -501,7 +502,7 @@ static int process_sample_event(union perf_event *event __used,
	}
	}


	te = (void *)sample->raw_data;
	te = (void *)sample->raw_data;
	if (session->sample_type & PERF_SAMPLE_RAW && sample->raw_size > 0) {
	if ((evsel->attr.sample_type & PERF_SAMPLE_RAW) && sample->raw_size > 0) {
		char *event_str;
		char *event_str;
#ifdef SUPPORT_OLD_POWER_EVENTS
#ifdef SUPPORT_OLD_POWER_EVENTS
		struct power_entry_old *peo;
		struct power_entry_old *peo;