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

Commit e4cc9f4a authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge branch 'perf/core' of...

Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/core
parents e9345aab 668b8788
Loading
Loading
Loading
Loading
+21 −2
Original line number Original line Diff line number Diff line
@@ -8,7 +8,7 @@ perf-list - List all symbolic event types
SYNOPSIS
SYNOPSIS
--------
--------
[verse]
[verse]
'perf list'
'perf list' [hw|sw|cache|tracepoint|event_glob]


DESCRIPTION
DESCRIPTION
-----------
-----------
@@ -63,7 +63,26 @@ details. Some of them are referenced in the SEE ALSO section below.


OPTIONS
OPTIONS
-------
-------
None

Without options all known events will be listed.

To limit the list use:

. 'hw' or 'hardware' to list hardware events such as cache-misses, etc.

. 'sw' or 'software' to list software events such as context switches, etc.

. 'cache' or 'hwcache' to list hardware cache events such as L1-dcache-loads, etc.

. 'tracepoint' to list all tracepoint events, alternatively use
  'subsys_glob:event_glob' to filter by tracepoint subsystems such as sched,
  block, etc.

. If none of the above is matched, it will apply the supplied glob to all
  events, printing the ones that match.

One or more types can be used at the same time, listing the events for the
types specified.


SEE ALSO
SEE ALSO
--------
--------
+41 −2
Original line number Original line Diff line number Diff line
@@ -5,6 +5,7 @@
 *
 *
 * Copyright (C) 2009, Thomas Gleixner <tglx@linutronix.de>
 * Copyright (C) 2009, Thomas Gleixner <tglx@linutronix.de>
 * Copyright (C) 2008-2009, Red Hat Inc, Ingo Molnar <mingo@redhat.com>
 * Copyright (C) 2008-2009, Red Hat Inc, Ingo Molnar <mingo@redhat.com>
 * Copyright (C) 2011, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com>
 */
 */
#include "builtin.h"
#include "builtin.h"


@@ -13,9 +14,47 @@
#include "util/parse-events.h"
#include "util/parse-events.h"
#include "util/cache.h"
#include "util/cache.h"


int cmd_list(int argc __used, const char **argv __used, const char *prefix __used)
int cmd_list(int argc, const char **argv, const char *prefix __used)
{
{
	setup_pager();
	setup_pager();
	print_events();

	if (argc == 1)
		print_events(NULL);
	else {
		int i;

		for (i = 1; i < argc; ++i) {
			if (i > 1)
				putchar('\n');
			if (strncmp(argv[i], "tracepoint", 10) == 0)
				print_tracepoint_events(NULL, NULL);
			else if (strcmp(argv[i], "hw") == 0 ||
				 strcmp(argv[i], "hardware") == 0)
				print_events_type(PERF_TYPE_HARDWARE);
			else if (strcmp(argv[i], "sw") == 0 ||
				 strcmp(argv[i], "software") == 0)
				print_events_type(PERF_TYPE_SOFTWARE);
			else if (strcmp(argv[i], "cache") == 0 ||
				 strcmp(argv[i], "hwcache") == 0)
				print_hwcache_events(NULL);
			else {
				char *sep = strchr(argv[i], ':'), *s;
				int sep_idx;

				if (sep == NULL) {
					print_events(argv[i]);
					continue;
				}
				sep_idx = sep - argv[i];
				s = strdup(argv[i]);
				if (s == NULL)
					return -1;

				s[sep_idx] = '\0';
				print_tracepoint_events(s, s + sep_idx + 1);
				free(s);
			}
		}
	}
	return 0;
	return 0;
}
}
+5 −5
Original line number Original line Diff line number Diff line
@@ -538,11 +538,6 @@ static int __cmd_record(int argc, const char **argv)
	if (have_tracepoints(&evsel_list->entries))
	if (have_tracepoints(&evsel_list->entries))
		perf_header__set_feat(&session->header, HEADER_TRACE_INFO);
		perf_header__set_feat(&session->header, HEADER_TRACE_INFO);


	/*
 	 * perf_session__delete(session) will be called at atexit_header()
	 */
	atexit(atexit_header);

	if (forks) {
	if (forks) {
		child_pid = fork();
		child_pid = fork();
		if (child_pid < 0) {
		if (child_pid < 0) {
@@ -601,6 +596,11 @@ static int __cmd_record(int argc, const char **argv)


	perf_session__set_sample_type(session, sample_type);
	perf_session__set_sample_type(session, sample_type);


	/*
	 * perf_session__delete(session) will be called at atexit_header()
	 */
	atexit(atexit_header);

	if (pipe_output) {
	if (pipe_output) {
		err = perf_header__write_pipe(output);
		err = perf_header__write_pipe(output);
		if (err < 0)
		if (err < 0)
+6 −0
Original line number Original line Diff line number Diff line
@@ -350,6 +350,12 @@ static int __cmd_report(void)
		perf_session__fprintf_dsos(session, stdout);
		perf_session__fprintf_dsos(session, stdout);


	next = rb_first(&session->hists_tree);
	next = rb_first(&session->hists_tree);

	if (next == NULL) {
		ui__warning("The %s file has no samples!\n", input_name);
		goto out_delete;
	}

	while (next) {
	while (next) {
		struct hists *hists;
		struct hists *hists;


+1 −0
Original line number Original line Diff line number Diff line
@@ -86,6 +86,7 @@ void perf_evsel__delete(struct perf_evsel *evsel)
{
{
	perf_evsel__exit(evsel);
	perf_evsel__exit(evsel);
	close_cgroup(evsel->cgrp);
	close_cgroup(evsel->cgrp);
	free(evsel->name);
	free(evsel);
	free(evsel);
}
}


Loading