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

perf evsel: Rename perf_evsel__{str,int}val() and other tracepoint field metehods to to evsel__*()



As those are not 'struct evsel' methods, not part of tools/lib/perf/,
aka libperf, to whom the perf_ prefix belongs.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent aa8c406b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ static void hcall_event_get_key(struct evsel *evsel,
				struct event_key *key)
{
	key->info = 0;
	key->key = perf_evsel__intval(evsel, sample, "req");
	key->key = evsel__intval(evsel, sample, "req");
}

static const char *get_hcall_exit_reason(u64 exit_code)
+4 −4
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ static void event_icpt_insn_get_key(struct evsel *evsel,
{
	unsigned long insn;

	insn = perf_evsel__intval(evsel, sample, "instruction");
	insn = evsel__intval(evsel, sample, "instruction");
	key->key = icpt_insn_decoder(insn);
	key->exit_reasons = sie_icpt_insn_codes;
}
@@ -39,7 +39,7 @@ static void event_sigp_get_key(struct evsel *evsel,
			       struct perf_sample *sample,
			       struct event_key *key)
{
	key->key = perf_evsel__intval(evsel, sample, "order_code");
	key->key = evsel__intval(evsel, sample, "order_code");
	key->exit_reasons = sie_sigp_order_codes;
}

@@ -47,7 +47,7 @@ static void event_diag_get_key(struct evsel *evsel,
			       struct perf_sample *sample,
			       struct event_key *key)
{
	key->key = perf_evsel__intval(evsel, sample, "code");
	key->key = evsel__intval(evsel, sample, "code");
	key->exit_reasons = sie_diagnose_codes;
}

@@ -55,7 +55,7 @@ static void event_icpt_prog_get_key(struct evsel *evsel,
				    struct perf_sample *sample,
				    struct event_key *key)
{
	key->key = perf_evsel__intval(evsel, sample, "code");
	key->key = evsel__intval(evsel, sample, "code");
	key->exit_reasons = sie_icpt_prog_codes;
}

+6 −6
Original line number Diff line number Diff line
@@ -31,8 +31,8 @@ const char *kvm_exit_trace = "kvm:kvm_exit";
static void mmio_event_get_key(struct evsel *evsel, struct perf_sample *sample,
			       struct event_key *key)
{
	key->key  = perf_evsel__intval(evsel, sample, "gpa");
	key->info = perf_evsel__intval(evsel, sample, "type");
	key->key  = evsel__intval(evsel, sample, "gpa");
	key->info = evsel__intval(evsel, sample, "type");
}

#define KVM_TRACE_MMIO_READ_UNSATISFIED 0
@@ -48,7 +48,7 @@ static bool mmio_event_begin(struct evsel *evsel,

	/* MMIO write begin event in kernel. */
	if (!strcmp(evsel->name, "kvm:kvm_mmio") &&
	    perf_evsel__intval(evsel, sample, "type") == KVM_TRACE_MMIO_WRITE) {
	    evsel__intval(evsel, sample, "type") == KVM_TRACE_MMIO_WRITE) {
		mmio_event_get_key(evsel, sample, key);
		return true;
	}
@@ -65,7 +65,7 @@ static bool mmio_event_end(struct evsel *evsel, struct perf_sample *sample,

	/* MMIO read end event in kernel.*/
	if (!strcmp(evsel->name, "kvm:kvm_mmio") &&
	    perf_evsel__intval(evsel, sample, "type") == KVM_TRACE_MMIO_READ) {
	    evsel__intval(evsel, sample, "type") == KVM_TRACE_MMIO_READ) {
		mmio_event_get_key(evsel, sample, key);
		return true;
	}
@@ -94,8 +94,8 @@ static void ioport_event_get_key(struct evsel *evsel,
				 struct perf_sample *sample,
				 struct event_key *key)
{
	key->key  = perf_evsel__intval(evsel, sample, "port");
	key->info = perf_evsel__intval(evsel, sample, "rw");
	key->key  = evsel__intval(evsel, sample, "port");
	key->info = evsel__intval(evsel, sample, "rw");
}

static bool ioport_event_begin(struct evsel *evsel,
+1 −1
Original line number Diff line number Diff line
@@ -536,7 +536,7 @@ static int perf_inject__sched_stat(struct perf_tool *tool,
	union perf_event *event_sw;
	struct perf_sample sample_sw;
	struct perf_inject *inject = container_of(tool, struct perf_inject, tool);
	u32 pid = perf_evsel__intval(evsel, sample, "pid");
	u32 pid = evsel__intval(evsel, sample, "pid");

	list_for_each_entry(ent, &inject->samples, node) {
		if (pid == ent->tid)
+15 −15
Original line number Diff line number Diff line
@@ -172,10 +172,10 @@ static int insert_caller_stat(unsigned long call_site,
static int perf_evsel__process_alloc_event(struct evsel *evsel,
					   struct perf_sample *sample)
{
	unsigned long ptr = perf_evsel__intval(evsel, sample, "ptr"),
		      call_site = perf_evsel__intval(evsel, sample, "call_site");
	int bytes_req = perf_evsel__intval(evsel, sample, "bytes_req"),
	    bytes_alloc = perf_evsel__intval(evsel, sample, "bytes_alloc");
	unsigned long ptr = evsel__intval(evsel, sample, "ptr"),
		      call_site = evsel__intval(evsel, sample, "call_site");
	int bytes_req = evsel__intval(evsel, sample, "bytes_req"),
	    bytes_alloc = evsel__intval(evsel, sample, "bytes_alloc");

	if (insert_alloc_stat(call_site, ptr, bytes_req, bytes_alloc, sample->cpu) ||
	    insert_caller_stat(call_site, bytes_req, bytes_alloc))
@@ -195,7 +195,7 @@ static int perf_evsel__process_alloc_node_event(struct evsel *evsel,

	if (!ret) {
		int node1 = cpu__get_node(sample->cpu),
		    node2 = perf_evsel__intval(evsel, sample, "node");
		    node2 = evsel__intval(evsel, sample, "node");

		if (node1 != node2)
			nr_cross_allocs++;
@@ -235,7 +235,7 @@ static struct alloc_stat *search_alloc_stat(unsigned long ptr,
static int perf_evsel__process_free_event(struct evsel *evsel,
					  struct perf_sample *sample)
{
	unsigned long ptr = perf_evsel__intval(evsel, sample, "ptr");
	unsigned long ptr = evsel__intval(evsel, sample, "ptr");
	struct alloc_stat *s_alloc, *s_caller;

	s_alloc = search_alloc_stat(ptr, 0, &root_alloc_stat, ptr_cmp);
@@ -788,9 +788,9 @@ static int perf_evsel__process_page_alloc_event(struct evsel *evsel,
						struct perf_sample *sample)
{
	u64 page;
	unsigned int order = perf_evsel__intval(evsel, sample, "order");
	unsigned int gfp_flags = perf_evsel__intval(evsel, sample, "gfp_flags");
	unsigned int migrate_type = perf_evsel__intval(evsel, sample,
	unsigned int order = evsel__intval(evsel, sample, "order");
	unsigned int gfp_flags = evsel__intval(evsel, sample, "gfp_flags");
	unsigned int migrate_type = evsel__intval(evsel, sample,
						       "migratetype");
	u64 bytes = kmem_page_size << order;
	u64 callsite;
@@ -802,9 +802,9 @@ static int perf_evsel__process_page_alloc_event(struct evsel *evsel,
	};

	if (use_pfn)
		page = perf_evsel__intval(evsel, sample, "pfn");
		page = evsel__intval(evsel, sample, "pfn");
	else
		page = perf_evsel__intval(evsel, sample, "page");
		page = evsel__intval(evsel, sample, "page");

	nr_page_allocs++;
	total_page_alloc_bytes += bytes;
@@ -861,7 +861,7 @@ static int perf_evsel__process_page_free_event(struct evsel *evsel,
						struct perf_sample *sample)
{
	u64 page;
	unsigned int order = perf_evsel__intval(evsel, sample, "order");
	unsigned int order = evsel__intval(evsel, sample, "order");
	u64 bytes = kmem_page_size << order;
	struct page_stat *pstat;
	struct page_stat this = {
@@ -869,9 +869,9 @@ static int perf_evsel__process_page_free_event(struct evsel *evsel,
	};

	if (use_pfn)
		page = perf_evsel__intval(evsel, sample, "pfn");
		page = evsel__intval(evsel, sample, "pfn");
	else
		page = perf_evsel__intval(evsel, sample, "page");
		page = evsel__intval(evsel, sample, "page");

	nr_page_frees++;
	total_page_free_bytes += bytes;
@@ -1392,7 +1392,7 @@ static int __cmd_kmem(struct perf_session *session)

	evlist__for_each_entry(session->evlist, evsel) {
		if (!strcmp(evsel__name(evsel), "kmem:mm_page_alloc") &&
		    perf_evsel__field(evsel, "pfn")) {
		    evsel__field(evsel, "pfn")) {
			use_pfn = true;
			break;
		}
Loading