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

Commit 05372173 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo
Browse files

perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback



Replacing perf_evsel arg perf_hpp_fmt's header callback with hists
object.

None of the actual callbacks actually use evsel object, also this will
be helpful in future for non evsel related hist browsers.

Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1465928361-2442-10-git-send-email-jolsa@kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent d05e3aae
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1045,7 +1045,7 @@ static int hpp__entry_global(struct perf_hpp_fmt *_fmt, struct perf_hpp *hpp,
}

static int hpp__header(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
		       struct perf_evsel *evsel __maybe_unused)
		       struct hists *hists __maybe_unused)
{
	struct diff_hpp_fmt *dfmt =
		container_of(fmt, struct diff_hpp_fmt, fmt);
+3 −3
Original line number Diff line number Diff line
@@ -1531,7 +1531,7 @@ static int hists_browser__scnprintf_headers(struct hist_browser *browser, char *
		if (perf_hpp__should_skip(fmt, hists)  || column++ < browser->b.horiz_scroll)
			continue;

		ret = fmt->header(fmt, &dummy_hpp, hists_to_evsel(hists));
		ret = fmt->header(fmt, &dummy_hpp, hists);
		if (advance_hpp_check(&dummy_hpp, ret))
			break;

@@ -1568,7 +1568,7 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows
		if (column++ < browser->b.horiz_scroll)
			continue;

		ret = fmt->header(fmt, &dummy_hpp, hists_to_evsel(hists));
		ret = fmt->header(fmt, &dummy_hpp, hists);
		if (advance_hpp_check(&dummy_hpp, ret))
			break;

@@ -1605,7 +1605,7 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows
			}
			first_col = false;

			ret = fmt->header(fmt, &dummy_hpp, hists_to_evsel(hists));
			ret = fmt->header(fmt, &dummy_hpp, hists);
			dummy_hpp.buf[ret] = '\0';

			start = trim(dummy_hpp.buf);
+1 −1
Original line number Diff line number Diff line
@@ -549,7 +549,7 @@ static void perf_gtk__show_hierarchy(GtkWidget *window, struct hists *hists,
				strcat(buf, "+");
			first_col = false;

			fmt->header(fmt, &hpp, hists_to_evsel(hists));
			fmt->header(fmt, &hpp, hists);
			strcat(buf, ltrim(rtrim(hpp.buf)));
		}
	}
+2 −2
Original line number Diff line number Diff line
@@ -229,9 +229,9 @@ static int hpp__width_fn(struct perf_hpp_fmt *fmt,
}

static int hpp__header_fn(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
			  struct perf_evsel *evsel)
			  struct hists *hists)
{
	int len = hpp__width_fn(fmt, hpp, evsel);
	int len = hpp__width_fn(fmt, hpp, hists_to_evsel(hists));
	return scnprintf(hpp->buf, hpp->size, "%*s", len, fmt->name);
}

+3 −3
Original line number Diff line number Diff line
@@ -549,7 +549,7 @@ static int print_hierarchy_header(struct hists *hists, struct perf_hpp *hpp,
				    struct perf_hpp_list_node, list);

	perf_hpp_list__for_each_format(&fmt_node->hpp, fmt) {
		fmt->header(fmt, hpp, hists_to_evsel(hists));
		fmt->header(fmt, hpp, hists);
		fprintf(fp, "%s%s", hpp->buf, sep ?: "  ");
	}

@@ -569,7 +569,7 @@ static int print_hierarchy_header(struct hists *hists, struct perf_hpp *hpp,
				header_width += fprintf(fp, "+");
			first_col = false;

			fmt->header(fmt, hpp, hists_to_evsel(hists));
			fmt->header(fmt, hpp, hists);

			header_width += fprintf(fp, "%s", trim(hpp->buf));
		}
@@ -658,7 +658,7 @@ hists__fprintf_standard_headers(struct hists *hists,
		else
			first = false;

		fmt->header(fmt, hpp, hists_to_evsel(hists));
		fmt->header(fmt, hpp, hists);
		fprintf(fp, "%s", hpp->buf);
	}

Loading