mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [GIT PULL 0/6] perf/core improvements and fixes
@ 2011-04-20 16:23 Arnaldo Carvalho de Melo
  2011-04-20 16:23 ` [PATCH 1/6] perf symbols: Give more useful names to 'self' parameters Arnaldo Carvalho de Melo
                   ` (6 more replies)
  0 siblings, 7 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-04-20 16:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Arun Sharma,
	Frederic Weisbecker, Michael Witten, Mike Galbraith,
	Paul Mackerras, Peter Zijlstra, Raghavendra D Prabhu,
	Stephane Eranian, Thomas Gleixner, Tom Zanussi,
	Arnaldo Carvalho de Melo

Hi Ingo,

        Please consider pulling from:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf/core

Regards,

- Arnaldo

Arnaldo Carvalho de Melo (1):
  perf symbols: Give more useful names to 'self' parameters

Arun Sharma (1):
  perf script: Add support for PERF_TYPE_RAW

Michael Witten (4):
  perf tools: Makefile: Clean up `python/perf.so' rule
  perf tools: Makefile: PYTHON{,_CONFIG} to bandage Python 3 incompatibility
  perf tools: Move `try-cc'
  perf tools: git mv tools/perf/{features-tests.mak,config/}

 tools/perf/Makefile                 |  107 +++++--
 tools/perf/builtin-script.c         |   14 +-
 tools/perf/config/feature-tests.mak |  128 +++++++
 tools/perf/config/utilities.mak     |  188 +++++++++++
 tools/perf/feature-tests.mak        |  130 -------
 tools/perf/util/symbol.c            |  629 ++++++++++++++++++-----------------
 tools/perf/util/symbol.h            |   78 +++--
 7 files changed, 771 insertions(+), 503 deletions(-)
 create mode 100644 tools/perf/config/feature-tests.mak
 create mode 100644 tools/perf/config/utilities.mak
 delete mode 100644 tools/perf/feature-tests.mak


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 1/6] perf symbols: Give more useful names to 'self' parameters
  2011-04-20 16:23 [GIT PULL 0/6] perf/core improvements and fixes Arnaldo Carvalho de Melo
@ 2011-04-20 16:23 ` Arnaldo Carvalho de Melo
  2011-04-20 16:23 ` [PATCH 2/6] perf tools: Makefile: Clean up `python/perf.so' rule Arnaldo Carvalho de Melo
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-04-20 16:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Frederic Weisbecker,
	Ingo Molnar, Mike Galbraith, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian, Thomas Gleixner, Tom Zanussi

From: Arnaldo Carvalho de Melo <acme@redhat.com>

One more installment on an area that is mostly dormant.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/symbol.c |  629 +++++++++++++++++++++++-----------------------
 tools/perf/util/symbol.h |   78 +++---
 2 files changed, 361 insertions(+), 346 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index f06c10f..516876d 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -31,13 +31,13 @@
 #define NT_GNU_BUILD_ID 3
 #endif
 
-static bool dso__build_id_equal(const struct dso *self, u8 *build_id);
+static bool dso__build_id_equal(const struct dso *dso, u8 *build_id);
 static int elf_read_build_id(Elf *elf, void *bf, size_t size);
 static void dsos__add(struct list_head *head, struct dso *dso);
 static struct map *map__new2(u64 start, struct dso *dso, enum map_type type);
-static int dso__load_kernel_sym(struct dso *self, struct map *map,
+static int dso__load_kernel_sym(struct dso *dso, struct map *map,
 				symbol_filter_t filter);
-static int dso__load_guest_kernel_sym(struct dso *self, struct map *map,
+static int dso__load_guest_kernel_sym(struct dso *dso, struct map *map,
 			symbol_filter_t filter);
 static int vmlinux_path__nr_entries;
 static char **vmlinux_path;
@@ -49,27 +49,27 @@ struct symbol_conf symbol_conf = {
 	.symfs            = "",
 };
 
-int dso__name_len(const struct dso *self)
+int dso__name_len(const struct dso *dso)
 {
 	if (verbose)
-		return self->long_name_len;
+		return dso->long_name_len;
 
-	return self->short_name_len;
+	return dso->short_name_len;
 }
 
-bool dso__loaded(const struct dso *self, enum map_type type)
+bool dso__loaded(const struct dso *dso, enum map_type type)
 {
-	return self->loaded & (1 << type);
+	return dso->loaded & (1 << type);
 }
 
-bool dso__sorted_by_name(const struct dso *self, enum map_type type)
+bool dso__sorted_by_name(const struct dso *dso, enum map_type type)
 {
-	return self->sorted_by_name & (1 << type);
+	return dso->sorted_by_name & (1 << type);
 }
 
-static void dso__set_sorted_by_name(struct dso *self, enum map_type type)
+static void dso__set_sorted_by_name(struct dso *dso, enum map_type type)
 {
-	self->sorted_by_name |= (1 << type);
+	dso->sorted_by_name |= (1 << type);
 }
 
 bool symbol_type__is_a(char symbol_type, enum map_type map_type)
@@ -84,9 +84,9 @@ bool symbol_type__is_a(char symbol_type, enum map_type map_type)
 	}
 }
 
-static void symbols__fixup_end(struct rb_root *self)
+static void symbols__fixup_end(struct rb_root *symbols)
 {
-	struct rb_node *nd, *prevnd = rb_first(self);
+	struct rb_node *nd, *prevnd = rb_first(symbols);
 	struct symbol *curr, *prev;
 
 	if (prevnd == NULL)
@@ -107,10 +107,10 @@ static void symbols__fixup_end(struct rb_root *self)
 		curr->end = roundup(curr->start, 4096);
 }
 
-static void __map_groups__fixup_end(struct map_groups *self, enum map_type type)
+static void __map_groups__fixup_end(struct map_groups *mg, enum map_type type)
 {
 	struct map *prev, *curr;
-	struct rb_node *nd, *prevnd = rb_first(&self->maps[type]);
+	struct rb_node *nd, *prevnd = rb_first(&mg->maps[type]);
 
 	if (prevnd == NULL)
 		return;
@@ -130,128 +130,128 @@ static void __map_groups__fixup_end(struct map_groups *self, enum map_type type)
 	curr->end = ~0ULL;
 }
 
-static void map_groups__fixup_end(struct map_groups *self)
+static void map_groups__fixup_end(struct map_groups *mg)
 {
 	int i;
 	for (i = 0; i < MAP__NR_TYPES; ++i)
-		__map_groups__fixup_end(self, i);
+		__map_groups__fixup_end(mg, i);
 }
 
 static struct symbol *symbol__new(u64 start, u64 len, u8 binding,
 				  const char *name)
 {
 	size_t namelen = strlen(name) + 1;
-	struct symbol *self = calloc(1, (symbol_conf.priv_size +
-					 sizeof(*self) + namelen));
-	if (self == NULL)
+	struct symbol *sym = calloc(1, (symbol_conf.priv_size +
+					sizeof(*sym) + namelen));
+	if (sym == NULL)
 		return NULL;
 
 	if (symbol_conf.priv_size)
-		self = ((void *)self) + symbol_conf.priv_size;
-
-	self->start   = start;
-	self->end     = len ? start + len - 1 : start;
-	self->binding = binding;
-	self->namelen = namelen - 1;
+		sym = ((void *)sym) + symbol_conf.priv_size;
 
-	pr_debug4("%s: %s %#" PRIx64 "-%#" PRIx64 "\n", __func__, name, start, self->end);
+	sym->start   = start;
+	sym->end     = len ? start + len - 1 : start;
+	sym->binding = binding;
+	sym->namelen = namelen - 1;
 
-	memcpy(self->name, name, namelen);
+	pr_debug4("%s: %s %#" PRIx64 "-%#" PRIx64 "\n",
+		  __func__, name, start, sym->end);
+	memcpy(sym->name, name, namelen);
 
-	return self;
+	return sym;
 }
 
-void symbol__delete(struct symbol *self)
+void symbol__delete(struct symbol *sym)
 {
-	free(((void *)self) - symbol_conf.priv_size);
+	free(((void *)sym) - symbol_conf.priv_size);
 }
 
-static size_t symbol__fprintf(struct symbol *self, FILE *fp)
+static size_t symbol__fprintf(struct symbol *sym, FILE *fp)
 {
 	return fprintf(fp, " %" PRIx64 "-%" PRIx64 " %c %s\n",
-		       self->start, self->end,
-		       self->binding == STB_GLOBAL ? 'g' :
-		       self->binding == STB_LOCAL  ? 'l' : 'w',
-		       self->name);
+		       sym->start, sym->end,
+		       sym->binding == STB_GLOBAL ? 'g' :
+		       sym->binding == STB_LOCAL  ? 'l' : 'w',
+		       sym->name);
 }
 
-void dso__set_long_name(struct dso *self, char *name)
+void dso__set_long_name(struct dso *dso, char *name)
 {
 	if (name == NULL)
 		return;
-	self->long_name = name;
-	self->long_name_len = strlen(name);
+	dso->long_name = name;
+	dso->long_name_len = strlen(name);
 }
 
-static void dso__set_short_name(struct dso *self, const char *name)
+static void dso__set_short_name(struct dso *dso, const char *name)
 {
 	if (name == NULL)
 		return;
-	self->short_name = name;
-	self->short_name_len = strlen(name);
+	dso->short_name = name;
+	dso->short_name_len = strlen(name);
 }
 
-static void dso__set_basename(struct dso *self)
+static void dso__set_basename(struct dso *dso)
 {
-	dso__set_short_name(self, basename(self->long_name));
+	dso__set_short_name(dso, basename(dso->long_name));
 }
 
 struct dso *dso__new(const char *name)
 {
-	struct dso *self = calloc(1, sizeof(*self) + strlen(name) + 1);
+	struct dso *dso = calloc(1, sizeof(*dso) + strlen(name) + 1);
 
-	if (self != NULL) {
+	if (dso != NULL) {
 		int i;
-		strcpy(self->name, name);
-		dso__set_long_name(self, self->name);
-		dso__set_short_name(self, self->name);
+		strcpy(dso->name, name);
+		dso__set_long_name(dso, dso->name);
+		dso__set_short_name(dso, dso->name);
 		for (i = 0; i < MAP__NR_TYPES; ++i)
-			self->symbols[i] = self->symbol_names[i] = RB_ROOT;
-		self->symtab_type = SYMTAB__NOT_FOUND;
-		self->loaded = 0;
-		self->sorted_by_name = 0;
-		self->has_build_id = 0;
-		self->kernel = DSO_TYPE_USER;
-		INIT_LIST_HEAD(&self->node);
+			dso->symbols[i] = dso->symbol_names[i] = RB_ROOT;
+		dso->symtab_type = SYMTAB__NOT_FOUND;
+		dso->loaded = 0;
+		dso->sorted_by_name = 0;
+		dso->has_build_id = 0;
+		dso->kernel = DSO_TYPE_USER;
+		INIT_LIST_HEAD(&dso->node);
 	}
 
-	return self;
+	return dso;
 }
 
-static void symbols__delete(struct rb_root *self)
+static void symbols__delete(struct rb_root *symbols)
 {
 	struct symbol *pos;
-	struct rb_node *next = rb_first(self);
+	struct rb_node *next = rb_first(symbols);
 
 	while (next) {
 		pos = rb_entry(next, struct symbol, rb_node);
 		next = rb_next(&pos->rb_node);
-		rb_erase(&pos->rb_node, self);
+		rb_erase(&pos->rb_node, symbols);
 		symbol__delete(pos);
 	}
 }
 
-void dso__delete(struct dso *self)
+void dso__delete(struct dso *dso)
 {
 	int i;
 	for (i = 0; i < MAP__NR_TYPES; ++i)
-		symbols__delete(&self->symbols[i]);
-	if (self->sname_alloc)
-		free((char *)self->short_name);
-	if (self->lname_alloc)
-		free(self->long_name);
-	free(self);
+		symbols__delete(&dso->symbols[i]);
+	if (dso->sname_alloc)
+		free((char *)dso->short_name);
+	if (dso->lname_alloc)
+		free(dso->long_name);
+	free(dso);
 }
 
-void dso__set_build_id(struct dso *self, void *build_id)
+void dso__set_build_id(struct dso *dso, void *build_id)
 {
-	memcpy(self->build_id, build_id, sizeof(self->build_id));
-	self->has_build_id = 1;
+	memcpy(dso->build_id, build_id, sizeof(dso->build_id));
+	dso->has_build_id = 1;
 }
 
-static void symbols__insert(struct rb_root *self, struct symbol *sym)
+static void symbols__insert(struct rb_root *symbols, struct symbol *sym)
 {
-	struct rb_node **p = &self->rb_node;
+	struct rb_node **p = &symbols->rb_node;
 	struct rb_node *parent = NULL;
 	const u64 ip = sym->start;
 	struct symbol *s;
@@ -265,17 +265,17 @@ static void symbols__insert(struct rb_root *self, struct symbol *sym)
 			p = &(*p)->rb_right;
 	}
 	rb_link_node(&sym->rb_node, parent, p);
-	rb_insert_color(&sym->rb_node, self);
+	rb_insert_color(&sym->rb_node, symbols);
 }
 
-static struct symbol *symbols__find(struct rb_root *self, u64 ip)
+static struct symbol *symbols__find(struct rb_root *symbols, u64 ip)
 {
 	struct rb_node *n;
 
-	if (self == NULL)
+	if (symbols == NULL)
 		return NULL;
 
-	n = self->rb_node;
+	n = symbols->rb_node;
 
 	while (n) {
 		struct symbol *s = rb_entry(n, struct symbol, rb_node);
@@ -296,9 +296,9 @@ struct symbol_name_rb_node {
 	struct symbol	sym;
 };
 
-static void symbols__insert_by_name(struct rb_root *self, struct symbol *sym)
+static void symbols__insert_by_name(struct rb_root *symbols, struct symbol *sym)
 {
-	struct rb_node **p = &self->rb_node;
+	struct rb_node **p = &symbols->rb_node;
 	struct rb_node *parent = NULL;
 	struct symbol_name_rb_node *symn, *s;
 
@@ -313,27 +313,29 @@ static void symbols__insert_by_name(struct rb_root *self, struct symbol *sym)
 			p = &(*p)->rb_right;
 	}
 	rb_link_node(&symn->rb_node, parent, p);
-	rb_insert_color(&symn->rb_node, self);
+	rb_insert_color(&symn->rb_node, symbols);
 }
 
-static void symbols__sort_by_name(struct rb_root *self, struct rb_root *source)
+static void symbols__sort_by_name(struct rb_root *symbols,
+				  struct rb_root *source)
 {
 	struct rb_node *nd;
 
 	for (nd = rb_first(source); nd; nd = rb_next(nd)) {
 		struct symbol *pos = rb_entry(nd, struct symbol, rb_node);
-		symbols__insert_by_name(self, pos);
+		symbols__insert_by_name(symbols, pos);
 	}
 }
 
-static struct symbol *symbols__find_by_name(struct rb_root *self, const char *name)
+static struct symbol *symbols__find_by_name(struct rb_root *symbols,
+					    const char *name)
 {
 	struct rb_node *n;
 
-	if (self == NULL)
+	if (symbols == NULL)
 		return NULL;
 
-	n = self->rb_node;
+	n = symbols->rb_node;
 
 	while (n) {
 		struct symbol_name_rb_node *s;
@@ -353,29 +355,29 @@ static struct symbol *symbols__find_by_name(struct rb_root *self, const char *na
 	return NULL;
 }
 
-struct symbol *dso__find_symbol(struct dso *self,
+struct symbol *dso__find_symbol(struct dso *dso,
 				enum map_type type, u64 addr)
 {
-	return symbols__find(&self->symbols[type], addr);
+	return symbols__find(&dso->symbols[type], addr);
 }
 
-struct symbol *dso__find_symbol_by_name(struct dso *self, enum map_type type,
+struct symbol *dso__find_symbol_by_name(struct dso *dso, enum map_type type,
 					const char *name)
 {
-	return symbols__find_by_name(&self->symbol_names[type], name);
+	return symbols__find_by_name(&dso->symbol_names[type], name);
 }
 
-void dso__sort_by_name(struct dso *self, enum map_type type)
+void dso__sort_by_name(struct dso *dso, enum map_type type)
 {
-	dso__set_sorted_by_name(self, type);
-	return symbols__sort_by_name(&self->symbol_names[type],
-				     &self->symbols[type]);
+	dso__set_sorted_by_name(dso, type);
+	return symbols__sort_by_name(&dso->symbol_names[type],
+				     &dso->symbols[type]);
 }
 
-int build_id__sprintf(const u8 *self, int len, char *bf)
+int build_id__sprintf(const u8 *build_id, int len, char *bf)
 {
 	char *bid = bf;
-	const u8 *raw = self;
+	const u8 *raw = build_id;
 	int i;
 
 	for (i = 0; i < len; ++i) {
@@ -384,24 +386,25 @@ int build_id__sprintf(const u8 *self, int len, char *bf)
 		bid += 2;
 	}
 
-	return raw - self;
+	return raw - build_id;
 }
 
-size_t dso__fprintf_buildid(struct dso *self, FILE *fp)
+size_t dso__fprintf_buildid(struct dso *dso, FILE *fp)
 {
 	char sbuild_id[BUILD_ID_SIZE * 2 + 1];
 
-	build_id__sprintf(self->build_id, sizeof(self->build_id), sbuild_id);
+	build_id__sprintf(dso->build_id, sizeof(dso->build_id), sbuild_id);
 	return fprintf(fp, "%s", sbuild_id);
 }
 
-size_t dso__fprintf_symbols_by_name(struct dso *self, enum map_type type, FILE *fp)
+size_t dso__fprintf_symbols_by_name(struct dso *dso,
+				    enum map_type type, FILE *fp)
 {
 	size_t ret = 0;
 	struct rb_node *nd;
 	struct symbol_name_rb_node *pos;
 
-	for (nd = rb_first(&self->symbol_names[type]); nd; nd = rb_next(nd)) {
+	for (nd = rb_first(&dso->symbol_names[type]); nd; nd = rb_next(nd)) {
 		pos = rb_entry(nd, struct symbol_name_rb_node, rb_node);
 		fprintf(fp, "%s\n", pos->sym.name);
 	}
@@ -409,18 +412,18 @@ size_t dso__fprintf_symbols_by_name(struct dso *self, enum map_type type, FILE *
 	return ret;
 }
 
-size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp)
+size_t dso__fprintf(struct dso *dso, enum map_type type, FILE *fp)
 {
 	struct rb_node *nd;
-	size_t ret = fprintf(fp, "dso: %s (", self->short_name);
+	size_t ret = fprintf(fp, "dso: %s (", dso->short_name);
 
-	if (self->short_name != self->long_name)
-		ret += fprintf(fp, "%s, ", self->long_name);
+	if (dso->short_name != dso->long_name)
+		ret += fprintf(fp, "%s, ", dso->long_name);
 	ret += fprintf(fp, "%s, %sloaded, ", map_type__name[type],
-		       self->loaded ? "" : "NOT ");
-	ret += dso__fprintf_buildid(self, fp);
+		       dso->loaded ? "" : "NOT ");
+	ret += dso__fprintf_buildid(dso, fp);
 	ret += fprintf(fp, ")\n");
-	for (nd = rb_first(&self->symbols[type]); nd; nd = rb_next(nd)) {
+	for (nd = rb_first(&dso->symbols[type]); nd; nd = rb_next(nd)) {
 		struct symbol *pos = rb_entry(nd, struct symbol, rb_node);
 		ret += symbol__fprintf(pos, fp);
 	}
@@ -543,10 +546,10 @@ static int map__process_kallsym_symbol(void *arg, const char *name,
  * so that we can in the next step set the symbol ->end address and then
  * call kernel_maps__split_kallsyms.
  */
-static int dso__load_all_kallsyms(struct dso *self, const char *filename,
+static int dso__load_all_kallsyms(struct dso *dso, const char *filename,
 				  struct map *map)
 {
-	struct process_kallsyms_args args = { .map = map, .dso = self, };
+	struct process_kallsyms_args args = { .map = map, .dso = dso, };
 	return kallsyms__parse(filename, &args, map__process_kallsym_symbol);
 }
 
@@ -555,7 +558,7 @@ static int dso__load_all_kallsyms(struct dso *self, const char *filename,
  * kernel range is broken in several maps, named [kernel].N, as we don't have
  * the original ELF section names vmlinux have.
  */
-static int dso__split_kallsyms(struct dso *self, struct map *map,
+static int dso__split_kallsyms(struct dso *dso, struct map *map,
 			       symbol_filter_t filter)
 {
 	struct map_groups *kmaps = map__kmap(map)->kmaps;
@@ -563,7 +566,7 @@ static int dso__split_kallsyms(struct dso *self, struct map *map,
 	struct map *curr_map = map;
 	struct symbol *pos;
 	int count = 0, moved = 0;	
-	struct rb_root *root = &self->symbols[map->type];
+	struct rb_root *root = &dso->symbols[map->type];
 	struct rb_node *next = rb_first(root);
 	int kernel_range = 0;
 
@@ -582,7 +585,7 @@ static int dso__split_kallsyms(struct dso *self, struct map *map,
 
 			if (strcmp(curr_map->dso->short_name, module)) {
 				if (curr_map != map &&
-				    self->kernel == DSO_TYPE_GUEST_KERNEL &&
+				    dso->kernel == DSO_TYPE_GUEST_KERNEL &&
 				    machine__is_default_guest(machine)) {
 					/*
 					 * We assume all symbols of a module are
@@ -618,14 +621,14 @@ static int dso__split_kallsyms(struct dso *self, struct map *map,
 			pos->end   = curr_map->map_ip(curr_map, pos->end);
 		} else if (curr_map != map) {
 			char dso_name[PATH_MAX];
-			struct dso *dso;
+			struct dso *ndso;
 
 			if (count == 0) {
 				curr_map = map;
 				goto filter_symbol;
 			}
 
-			if (self->kernel == DSO_TYPE_GUEST_KERNEL)
+			if (dso->kernel == DSO_TYPE_GUEST_KERNEL)
 				snprintf(dso_name, sizeof(dso_name),
 					"[guest.kernel].%d",
 					kernel_range++);
@@ -634,15 +637,15 @@ static int dso__split_kallsyms(struct dso *self, struct map *map,
 					"[kernel].%d",
 					kernel_range++);
 
-			dso = dso__new(dso_name);
-			if (dso == NULL)
+			ndso = dso__new(dso_name);
+			if (ndso == NULL)
 				return -1;
 
-			dso->kernel = self->kernel;
+			ndso->kernel = dso->kernel;
 
-			curr_map = map__new2(pos->start, dso, map->type);
+			curr_map = map__new2(pos->start, ndso, map->type);
 			if (curr_map == NULL) {
-				dso__delete(dso);
+				dso__delete(ndso);
 				return -1;
 			}
 
@@ -665,7 +668,7 @@ discard_symbol:		rb_erase(&pos->rb_node, root);
 	}
 
 	if (curr_map != map &&
-	    self->kernel == DSO_TYPE_GUEST_KERNEL &&
+	    dso->kernel == DSO_TYPE_GUEST_KERNEL &&
 	    machine__is_default_guest(kmaps->machine)) {
 		dso__set_loaded(curr_map->dso, curr_map->type);
 	}
@@ -673,21 +676,21 @@ discard_symbol:		rb_erase(&pos->rb_node, root);
 	return count + moved;
 }
 
-int dso__load_kallsyms(struct dso *self, const char *filename,
+int dso__load_kallsyms(struct dso *dso, const char *filename,
 		       struct map *map, symbol_filter_t filter)
 {
-	if (dso__load_all_kallsyms(self, filename, map) < 0)
+	if (dso__load_all_kallsyms(dso, filename, map) < 0)
 		return -1;
 
-	if (self->kernel == DSO_TYPE_GUEST_KERNEL)
-		self->symtab_type = SYMTAB__GUEST_KALLSYMS;
+	if (dso->kernel == DSO_TYPE_GUEST_KERNEL)
+		dso->symtab_type = SYMTAB__GUEST_KALLSYMS;
 	else
-		self->symtab_type = SYMTAB__KALLSYMS;
+		dso->symtab_type = SYMTAB__KALLSYMS;
 
-	return dso__split_kallsyms(self, map, filter);
+	return dso__split_kallsyms(dso, map, filter);
 }
 
-static int dso__load_perf_map(struct dso *self, struct map *map,
+static int dso__load_perf_map(struct dso *dso, struct map *map,
 			      symbol_filter_t filter)
 {
 	char *line = NULL;
@@ -695,7 +698,7 @@ static int dso__load_perf_map(struct dso *self, struct map *map,
 	FILE *file;
 	int nr_syms = 0;
 
-	file = fopen(self->long_name, "r");
+	file = fopen(dso->long_name, "r");
 	if (file == NULL)
 		goto out_failure;
 
@@ -733,7 +736,7 @@ static int dso__load_perf_map(struct dso *self, struct map *map,
 		if (filter && filter(map, sym))
 			symbol__delete(sym);
 		else {
-			symbols__insert(&self->symbols[map->type], sym);
+			symbols__insert(&dso->symbols[map->type], sym);
 			nr_syms++;
 		}
 	}
@@ -752,7 +755,7 @@ out_failure:
 /**
  * elf_symtab__for_each_symbol - iterate thru all the symbols
  *
- * @self: struct elf_symtab instance to iterate
+ * @syms: struct elf_symtab instance to iterate
  * @idx: uint32_t idx
  * @sym: GElf_Sym iterator
  */
@@ -852,7 +855,7 @@ static Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
  * And always look at the original dso, not at debuginfo packages, that
  * have the PLT data stripped out (shdr_rel_plt.sh_type == SHT_NOBITS).
  */
-static int dso__synthesize_plt_symbols(struct  dso *self, struct map *map,
+static int dso__synthesize_plt_symbols(struct  dso *dso, struct map *map,
 				       symbol_filter_t filter)
 {
 	uint32_t nr_rel_entries, idx;
@@ -871,7 +874,7 @@ static int dso__synthesize_plt_symbols(struct  dso *self, struct map *map,
 	char name[PATH_MAX];
 
 	snprintf(name, sizeof(name), "%s%s",
-		 symbol_conf.symfs, self->long_name);
+		 symbol_conf.symfs, dso->long_name);
 	fd = open(name, O_RDONLY);
 	if (fd < 0)
 		goto out;
@@ -947,7 +950,7 @@ static int dso__synthesize_plt_symbols(struct  dso *self, struct map *map,
 			if (filter && filter(map, f))
 				symbol__delete(f);
 			else {
-				symbols__insert(&self->symbols[map->type], f);
+				symbols__insert(&dso->symbols[map->type], f);
 				++nr;
 			}
 		}
@@ -969,7 +972,7 @@ static int dso__synthesize_plt_symbols(struct  dso *self, struct map *map,
 			if (filter && filter(map, f))
 				symbol__delete(f);
 			else {
-				symbols__insert(&self->symbols[map->type], f);
+				symbols__insert(&dso->symbols[map->type], f);
 				++nr;
 			}
 		}
@@ -985,29 +988,30 @@ out_close:
 		return nr;
 out:
 	pr_debug("%s: problems reading %s PLT info.\n",
-		 __func__, self->long_name);
+		 __func__, dso->long_name);
 	return 0;
 }
 
-static bool elf_sym__is_a(GElf_Sym *self, enum map_type type)
+static bool elf_sym__is_a(GElf_Sym *sym, enum map_type type)
 {
 	switch (type) {
 	case MAP__FUNCTION:
-		return elf_sym__is_function(self);
+		return elf_sym__is_function(sym);
 	case MAP__VARIABLE:
-		return elf_sym__is_object(self);
+		return elf_sym__is_object(sym);
 	default:
 		return false;
 	}
 }
 
-static bool elf_sec__is_a(GElf_Shdr *self, Elf_Data *secstrs, enum map_type type)
+static bool elf_sec__is_a(GElf_Shdr *shdr, Elf_Data *secstrs,
+			  enum map_type type)
 {
 	switch (type) {
 	case MAP__FUNCTION:
-		return elf_sec__is_text(self, secstrs);
+		return elf_sec__is_text(shdr, secstrs);
 	case MAP__VARIABLE:
-		return elf_sec__is_data(self, secstrs);
+		return elf_sec__is_data(shdr, secstrs);
 	default:
 		return false;
 	}
@@ -1032,13 +1036,13 @@ static size_t elf_addr_to_index(Elf *elf, GElf_Addr addr)
 	return -1;
 }
 
-static int dso__load_sym(struct dso *self, struct map *map, const char *name,
+static int dso__load_sym(struct dso *dso, struct map *map, const char *name,
 			 int fd, symbol_filter_t filter, int kmodule,
 			 int want_symtab)
 {
-	struct kmap *kmap = self->kernel ? map__kmap(map) : NULL;
+	struct kmap *kmap = dso->kernel ? map__kmap(map) : NULL;
 	struct map *curr_map = map;
-	struct dso *curr_dso = self;
+	struct dso *curr_dso = dso;
 	Elf_Data *symstrs, *secstrs;
 	uint32_t nr_syms;
 	int err = -1;
@@ -1064,14 +1068,14 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name,
 	}
 
 	/* Always reject images with a mismatched build-id: */
-	if (self->has_build_id) {
+	if (dso->has_build_id) {
 		u8 build_id[BUILD_ID_SIZE];
 
 		if (elf_read_build_id(elf, build_id,
 				      BUILD_ID_SIZE) != BUILD_ID_SIZE)
 			goto out_elf_end;
 
-		if (!dso__build_id_equal(self, build_id))
+		if (!dso__build_id_equal(dso, build_id))
 			goto out_elf_end;
 	}
 
@@ -1112,13 +1116,14 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name,
 	nr_syms = shdr.sh_size / shdr.sh_entsize;
 
 	memset(&sym, 0, sizeof(sym));
-	if (self->kernel == DSO_TYPE_USER) {
-		self->adjust_symbols = (ehdr.e_type == ET_EXEC ||
+	if (dso->kernel == DSO_TYPE_USER) {
+		dso->adjust_symbols = (ehdr.e_type == ET_EXEC ||
 				elf_section_by_name(elf, &ehdr, &shdr,
 						     ".gnu.prelink_undo",
 						     NULL) != NULL);
-	} else self->adjust_symbols = 0;
-
+	} else {
+		dso->adjust_symbols = 0;
+	}
 	elf_symtab__for_each_symbol(syms, nr_syms, idx, sym) {
 		struct symbol *f;
 		const char *elf_name = elf_sym__name(&sym, symstrs);
@@ -1168,22 +1173,22 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name,
 		    (sym.st_value & 1))
 			--sym.st_value;
 
-		if (self->kernel != DSO_TYPE_USER || kmodule) {
+		if (dso->kernel != DSO_TYPE_USER || kmodule) {
 			char dso_name[PATH_MAX];
 
 			if (strcmp(section_name,
 				   (curr_dso->short_name +
-				    self->short_name_len)) == 0)
+				    dso->short_name_len)) == 0)
 				goto new_symbol;
 
 			if (strcmp(section_name, ".text") == 0) {
 				curr_map = map;
-				curr_dso = self;
+				curr_dso = dso;
 				goto new_symbol;
 			}
 
 			snprintf(dso_name, sizeof(dso_name),
-				 "%s%s", self->short_name, section_name);
+				 "%s%s", dso->short_name, section_name);
 
 			curr_map = map_groups__find_by_name(kmap->kmaps, map->type, dso_name);
 			if (curr_map == NULL) {
@@ -1195,9 +1200,9 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name,
 				curr_dso = dso__new(dso_name);
 				if (curr_dso == NULL)
 					goto out_elf_end;
-				curr_dso->kernel = self->kernel;
-				curr_dso->long_name = self->long_name;
-				curr_dso->long_name_len = self->long_name_len;
+				curr_dso->kernel = dso->kernel;
+				curr_dso->long_name = dso->long_name;
+				curr_dso->long_name_len = dso->long_name_len;
 				curr_map = map__new2(start, curr_dso,
 						     map->type);
 				if (curr_map == NULL) {
@@ -1206,9 +1211,9 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name,
 				}
 				curr_map->map_ip = identity__map_ip;
 				curr_map->unmap_ip = identity__map_ip;
-				curr_dso->symtab_type = self->symtab_type;
+				curr_dso->symtab_type = dso->symtab_type;
 				map_groups__insert(kmap->kmaps, curr_map);
-				dsos__add(&self->node, curr_dso);
+				dsos__add(&dso->node, curr_dso);
 				dso__set_loaded(curr_dso, map->type);
 			} else
 				curr_dso = curr_map->dso;
@@ -1250,7 +1255,7 @@ new_symbol:
 	 * For misannotated, zeroed, ASM function sizes.
 	 */
 	if (nr > 0) {
-		symbols__fixup_end(&self->symbols[map->type]);
+		symbols__fixup_end(&dso->symbols[map->type]);
 		if (kmap) {
 			/*
 			 * We need to fixup this here too because we create new
@@ -1266,9 +1271,9 @@ out_close:
 	return err;
 }
 
-static bool dso__build_id_equal(const struct dso *self, u8 *build_id)
+static bool dso__build_id_equal(const struct dso *dso, u8 *build_id)
 {
-	return memcmp(self->build_id, build_id, sizeof(self->build_id)) == 0;
+	return memcmp(dso->build_id, build_id, sizeof(dso->build_id)) == 0;
 }
 
 bool __dsos__read_build_ids(struct list_head *head, bool with_hits)
@@ -1429,7 +1434,7 @@ out:
 	return err;
 }
 
-char dso__symtab_origin(const struct dso *self)
+char dso__symtab_origin(const struct dso *dso)
 {
 	static const char origin[] = {
 		[SYMTAB__KALLSYMS]	      = 'k',
@@ -1444,12 +1449,12 @@ char dso__symtab_origin(const struct dso *self)
 		[SYMTAB__GUEST_KMODULE]	      =  'G',
 	};
 
-	if (self == NULL || self->symtab_type == SYMTAB__NOT_FOUND)
+	if (dso == NULL || dso->symtab_type == SYMTAB__NOT_FOUND)
 		return '!';
-	return origin[self->symtab_type];
+	return origin[dso->symtab_type];
 }
 
-int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
+int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
 {
 	int size = PATH_MAX;
 	char *name;
@@ -1459,12 +1464,12 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
 	const char *root_dir;
 	int want_symtab;
 
-	dso__set_loaded(self, map->type);
+	dso__set_loaded(dso, map->type);
 
-	if (self->kernel == DSO_TYPE_KERNEL)
-		return dso__load_kernel_sym(self, map, filter);
-	else if (self->kernel == DSO_TYPE_GUEST_KERNEL)
-		return dso__load_guest_kernel_sym(self, map, filter);
+	if (dso->kernel == DSO_TYPE_KERNEL)
+		return dso__load_kernel_sym(dso, map, filter);
+	else if (dso->kernel == DSO_TYPE_GUEST_KERNEL)
+		return dso__load_guest_kernel_sym(dso, map, filter);
 
 	if (map->groups && map->groups->machine)
 		machine = map->groups->machine;
@@ -1475,11 +1480,11 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
 	if (!name)
 		return -1;
 
-	self->adjust_symbols = 0;
+	dso->adjust_symbols = 0;
 
-	if (strncmp(self->name, "/tmp/perf-", 10) == 0) {
-		ret = dso__load_perf_map(self, map, filter);
-		self->symtab_type = ret > 0 ? SYMTAB__JAVA_JIT :
+	if (strncmp(dso->name, "/tmp/perf-", 10) == 0) {
+		ret = dso__load_perf_map(dso, map, filter);
+		dso->symtab_type = ret > 0 ? SYMTAB__JAVA_JIT :
 					      SYMTAB__NOT_FOUND;
 		return ret;
 	}
@@ -1490,33 +1495,33 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
 	 */
 	want_symtab = 1;
 restart:
-	for (self->symtab_type = SYMTAB__BUILD_ID_CACHE;
-	     self->symtab_type != SYMTAB__NOT_FOUND;
-	     self->symtab_type++) {
-		switch (self->symtab_type) {
+	for (dso->symtab_type = SYMTAB__BUILD_ID_CACHE;
+	     dso->symtab_type != SYMTAB__NOT_FOUND;
+	     dso->symtab_type++) {
+		switch (dso->symtab_type) {
 		case SYMTAB__BUILD_ID_CACHE:
 			/* skip the locally configured cache if a symfs is given */
 			if (symbol_conf.symfs[0] ||
-			    (dso__build_id_filename(self, name, size) == NULL)) {
+			    (dso__build_id_filename(dso, name, size) == NULL)) {
 				continue;
 			}
 			break;
 		case SYMTAB__FEDORA_DEBUGINFO:
 			snprintf(name, size, "%s/usr/lib/debug%s.debug",
-				 symbol_conf.symfs, self->long_name);
+				 symbol_conf.symfs, dso->long_name);
 			break;
 		case SYMTAB__UBUNTU_DEBUGINFO:
 			snprintf(name, size, "%s/usr/lib/debug%s",
-				 symbol_conf.symfs, self->long_name);
+				 symbol_conf.symfs, dso->long_name);
 			break;
 		case SYMTAB__BUILDID_DEBUGINFO: {
 			char build_id_hex[BUILD_ID_SIZE * 2 + 1];
 
-			if (!self->has_build_id)
+			if (!dso->has_build_id)
 				continue;
 
-			build_id__sprintf(self->build_id,
-					  sizeof(self->build_id),
+			build_id__sprintf(dso->build_id,
+					  sizeof(dso->build_id),
 					  build_id_hex);
 			snprintf(name, size,
 				 "%s/usr/lib/debug/.build-id/%.2s/%s.debug",
@@ -1525,7 +1530,7 @@ restart:
 			break;
 		case SYMTAB__SYSTEM_PATH_DSO:
 			snprintf(name, size, "%s%s",
-			     symbol_conf.symfs, self->long_name);
+			     symbol_conf.symfs, dso->long_name);
 			break;
 		case SYMTAB__GUEST_KMODULE:
 			if (map->groups && machine)
@@ -1533,12 +1538,12 @@ restart:
 			else
 				root_dir = "";
 			snprintf(name, size, "%s%s%s", symbol_conf.symfs,
-				 root_dir, self->long_name);
+				 root_dir, dso->long_name);
 			break;
 
 		case SYMTAB__SYSTEM_PATH_KMODULE:
 			snprintf(name, size, "%s%s", symbol_conf.symfs,
-				 self->long_name);
+				 dso->long_name);
 			break;
 		default:;
 		}
@@ -1548,7 +1553,7 @@ restart:
 		if (fd < 0)
 			continue;
 
-		ret = dso__load_sym(self, map, name, fd, filter, 0,
+		ret = dso__load_sym(dso, map, name, fd, filter, 0,
 				    want_symtab);
 		close(fd);
 
@@ -1560,7 +1565,8 @@ restart:
 			continue;
 
 		if (ret > 0) {
-			int nr_plt = dso__synthesize_plt_symbols(self, map, filter);
+			int nr_plt = dso__synthesize_plt_symbols(dso, map,
+								 filter);
 			if (nr_plt > 0)
 				ret += nr_plt;
 			break;
@@ -1577,17 +1583,17 @@ restart:
 	}
 
 	free(name);
-	if (ret < 0 && strstr(self->name, " (deleted)") != NULL)
+	if (ret < 0 && strstr(dso->name, " (deleted)") != NULL)
 		return 0;
 	return ret;
 }
 
-struct map *map_groups__find_by_name(struct map_groups *self,
+struct map *map_groups__find_by_name(struct map_groups *mg,
 				     enum map_type type, const char *name)
 {
 	struct rb_node *nd;
 
-	for (nd = rb_first(&self->maps[type]); nd; nd = rb_next(nd)) {
+	for (nd = rb_first(&mg->maps[type]); nd; nd = rb_next(nd)) {
 		struct map *map = rb_entry(nd, struct map, rb_node);
 
 		if (map->dso && strcmp(map->dso->short_name, name) == 0)
@@ -1597,28 +1603,28 @@ struct map *map_groups__find_by_name(struct map_groups *self,
 	return NULL;
 }
 
-static int dso__kernel_module_get_build_id(struct dso *self,
-				const char *root_dir)
+static int dso__kernel_module_get_build_id(struct dso *dso,
+					   const char *root_dir)
 {
 	char filename[PATH_MAX];
 	/*
 	 * kernel module short names are of the form "[module]" and
 	 * we need just "module" here.
 	 */
-	const char *name = self->short_name + 1;
+	const char *name = dso->short_name + 1;
 
 	snprintf(filename, sizeof(filename),
 		 "%s/sys/module/%.*s/notes/.note.gnu.build-id",
 		 root_dir, (int)strlen(name) - 1, name);
 
-	if (sysfs__read_build_id(filename, self->build_id,
-				 sizeof(self->build_id)) == 0)
-		self->has_build_id = true;
+	if (sysfs__read_build_id(filename, dso->build_id,
+				 sizeof(dso->build_id)) == 0)
+		dso->has_build_id = true;
 
 	return 0;
 }
 
-static int map_groups__set_modules_path_dir(struct map_groups *self,
+static int map_groups__set_modules_path_dir(struct map_groups *mg,
 				const char *dir_name)
 {
 	struct dirent *dent;
@@ -1646,7 +1652,7 @@ static int map_groups__set_modules_path_dir(struct map_groups *self,
 
 			snprintf(path, sizeof(path), "%s/%s",
 				 dir_name, dent->d_name);
-			ret = map_groups__set_modules_path_dir(self, path);
+			ret = map_groups__set_modules_path_dir(mg, path);
 			if (ret < 0)
 				goto out;
 		} else {
@@ -1661,7 +1667,8 @@ static int map_groups__set_modules_path_dir(struct map_groups *self,
 				 (int)(dot - dent->d_name), dent->d_name);
 
 			strxfrchar(dso_name, '-', '_');
-			map = map_groups__find_by_name(self, MAP__FUNCTION, dso_name);
+			map = map_groups__find_by_name(mg, MAP__FUNCTION,
+						       dso_name);
 			if (map == NULL)
 				continue;
 
@@ -1711,20 +1718,20 @@ static char *get_kernel_version(const char *root_dir)
 	return strdup(name);
 }
 
-static int machine__set_modules_path(struct machine *self)
+static int machine__set_modules_path(struct machine *machine)
 {
 	char *version;
 	char modules_path[PATH_MAX];
 
-	version = get_kernel_version(self->root_dir);
+	version = get_kernel_version(machine->root_dir);
 	if (!version)
 		return -1;
 
 	snprintf(modules_path, sizeof(modules_path), "%s/lib/modules/%s/kernel",
-		 self->root_dir, version);
+		 machine->root_dir, version);
 	free(version);
 
-	return map_groups__set_modules_path_dir(&self->kmaps, modules_path);
+	return map_groups__set_modules_path_dir(&machine->kmaps, modules_path);
 }
 
 /*
@@ -1734,23 +1741,23 @@ static int machine__set_modules_path(struct machine *self)
  */
 static struct map *map__new2(u64 start, struct dso *dso, enum map_type type)
 {
-	struct map *self = calloc(1, (sizeof(*self) +
-				      (dso->kernel ? sizeof(struct kmap) : 0)));
-	if (self != NULL) {
+	struct map *map = calloc(1, (sizeof(*map) +
+				     (dso->kernel ? sizeof(struct kmap) : 0)));
+	if (map != NULL) {
 		/*
 		 * ->end will be filled after we load all the symbols
 		 */
-		map__init(self, type, start, 0, 0, dso);
+		map__init(map, type, start, 0, 0, dso);
 	}
 
-	return self;
+	return map;
 }
 
-struct map *machine__new_module(struct machine *self, u64 start,
+struct map *machine__new_module(struct machine *machine, u64 start,
 				const char *filename)
 {
 	struct map *map;
-	struct dso *dso = __dsos__findnew(&self->kernel_dsos, filename);
+	struct dso *dso = __dsos__findnew(&machine->kernel_dsos, filename);
 
 	if (dso == NULL)
 		return NULL;
@@ -1759,15 +1766,15 @@ struct map *machine__new_module(struct machine *self, u64 start,
 	if (map == NULL)
 		return NULL;
 
-	if (machine__is_host(self))
+	if (machine__is_host(machine))
 		dso->symtab_type = SYMTAB__SYSTEM_PATH_KMODULE;
 	else
 		dso->symtab_type = SYMTAB__GUEST_KMODULE;
-	map_groups__insert(&self->kmaps, map);
+	map_groups__insert(&machine->kmaps, map);
 	return map;
 }
 
-static int machine__create_modules(struct machine *self)
+static int machine__create_modules(struct machine *machine)
 {
 	char *line = NULL;
 	size_t n;
@@ -1776,10 +1783,10 @@ static int machine__create_modules(struct machine *self)
 	const char *modules;
 	char path[PATH_MAX];
 
-	if (machine__is_default_guest(self))
+	if (machine__is_default_guest(machine))
 		modules = symbol_conf.default_guest_modules;
 	else {
-		sprintf(path, "%s/proc/modules", self->root_dir);
+		sprintf(path, "%s/proc/modules", machine->root_dir);
 		modules = path;
 	}
 
@@ -1815,16 +1822,16 @@ static int machine__create_modules(struct machine *self)
 		*sep = '\0';
 
 		snprintf(name, sizeof(name), "[%s]", line);
-		map = machine__new_module(self, start, name);
+		map = machine__new_module(machine, start, name);
 		if (map == NULL)
 			goto out_delete_line;
-		dso__kernel_module_get_build_id(map->dso, self->root_dir);
+		dso__kernel_module_get_build_id(map->dso, machine->root_dir);
 	}
 
 	free(line);
 	fclose(file);
 
-	return machine__set_modules_path(self);
+	return machine__set_modules_path(machine);
 
 out_delete_line:
 	free(line);
@@ -1832,7 +1839,7 @@ out_failure:
 	return -1;
 }
 
-int dso__load_vmlinux(struct dso *self, struct map *map,
+int dso__load_vmlinux(struct dso *dso, struct map *map,
 		      const char *vmlinux, symbol_filter_t filter)
 {
 	int err = -1, fd;
@@ -1844,9 +1851,9 @@ int dso__load_vmlinux(struct dso *self, struct map *map,
 	if (fd < 0)
 		return -1;
 
-	dso__set_long_name(self, (char *)vmlinux);
-	dso__set_loaded(self, map->type);
-	err = dso__load_sym(self, map, symfs_vmlinux, fd, filter, 0, 0);
+	dso__set_long_name(dso, (char *)vmlinux);
+	dso__set_loaded(dso, map->type);
+	err = dso__load_sym(dso, map, symfs_vmlinux, fd, filter, 0, 0);
 	close(fd);
 
 	if (err > 0)
@@ -1855,7 +1862,7 @@ int dso__load_vmlinux(struct dso *self, struct map *map,
 	return err;
 }
 
-int dso__load_vmlinux_path(struct dso *self, struct map *map,
+int dso__load_vmlinux_path(struct dso *dso, struct map *map,
 			   symbol_filter_t filter)
 {
 	int i, err = 0;
@@ -1864,20 +1871,20 @@ int dso__load_vmlinux_path(struct dso *self, struct map *map,
 	pr_debug("Looking at the vmlinux_path (%d entries long)\n",
 		 vmlinux_path__nr_entries + 1);
 
-	filename = dso__build_id_filename(self, NULL, 0);
+	filename = dso__build_id_filename(dso, NULL, 0);
 	if (filename != NULL) {
-		err = dso__load_vmlinux(self, map, filename, filter);
+		err = dso__load_vmlinux(dso, map, filename, filter);
 		if (err > 0) {
-			dso__set_long_name(self, filename);
+			dso__set_long_name(dso, filename);
 			goto out;
 		}
 		free(filename);
 	}
 
 	for (i = 0; i < vmlinux_path__nr_entries; ++i) {
-		err = dso__load_vmlinux(self, map, vmlinux_path[i], filter);
+		err = dso__load_vmlinux(dso, map, vmlinux_path[i], filter);
 		if (err > 0) {
-			dso__set_long_name(self, strdup(vmlinux_path[i]));
+			dso__set_long_name(dso, strdup(vmlinux_path[i]));
 			break;
 		}
 	}
@@ -1885,7 +1892,7 @@ out:
 	return err;
 }
 
-static int dso__load_kernel_sym(struct dso *self, struct map *map,
+static int dso__load_kernel_sym(struct dso *dso, struct map *map,
 				symbol_filter_t filter)
 {
 	int err;
@@ -1912,10 +1919,10 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map,
 	}
 
 	if (symbol_conf.vmlinux_name != NULL) {
-		err = dso__load_vmlinux(self, map,
+		err = dso__load_vmlinux(dso, map,
 					symbol_conf.vmlinux_name, filter);
 		if (err > 0) {
-			dso__set_long_name(self,
+			dso__set_long_name(dso,
 					   strdup(symbol_conf.vmlinux_name));
 			goto out_fixup;
 		}
@@ -1923,7 +1930,7 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map,
 	}
 
 	if (vmlinux_path != NULL) {
-		err = dso__load_vmlinux_path(self, map, filter);
+		err = dso__load_vmlinux_path(dso, map, filter);
 		if (err > 0)
 			goto out_fixup;
 	}
@@ -1937,13 +1944,13 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map,
 	 * we have a build-id, so check if it is the same as the running kernel,
 	 * using it if it is.
 	 */
-	if (self->has_build_id) {
+	if (dso->has_build_id) {
 		u8 kallsyms_build_id[BUILD_ID_SIZE];
 		char sbuild_id[BUILD_ID_SIZE * 2 + 1];
 
 		if (sysfs__read_build_id("/sys/kernel/notes", kallsyms_build_id,
 					 sizeof(kallsyms_build_id)) == 0) {
-			if (dso__build_id_equal(self, kallsyms_build_id)) {
+			if (dso__build_id_equal(dso, kallsyms_build_id)) {
 				kallsyms_filename = "/proc/kallsyms";
 				goto do_kallsyms;
 			}
@@ -1952,7 +1959,7 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map,
 		 * Now look if we have it on the build-id cache in
 		 * $HOME/.debug/[kernel.kallsyms].
 		 */
-		build_id__sprintf(self->build_id, sizeof(self->build_id),
+		build_id__sprintf(dso->build_id, sizeof(dso->build_id),
 				  sbuild_id);
 
 		if (asprintf(&kallsyms_allocated_filename,
@@ -1979,7 +1986,7 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map,
 	}
 
 do_kallsyms:
-	err = dso__load_kallsyms(self, kallsyms_filename, map, filter);
+	err = dso__load_kallsyms(dso, kallsyms_filename, map, filter);
 	if (err > 0)
 		pr_debug("Using %s for symbols\n", kallsyms_filename);
 	free(kallsyms_allocated_filename);
@@ -1987,7 +1994,7 @@ do_kallsyms:
 	if (err > 0) {
 out_fixup:
 		if (kallsyms_filename != NULL)
-			dso__set_long_name(self, strdup("[kernel.kallsyms]"));
+			dso__set_long_name(dso, strdup("[kernel.kallsyms]"));
 		map__fixup_start(map);
 		map__fixup_end(map);
 	}
@@ -1995,8 +2002,8 @@ out_fixup:
 	return err;
 }
 
-static int dso__load_guest_kernel_sym(struct dso *self, struct map *map,
-				symbol_filter_t filter)
+static int dso__load_guest_kernel_sym(struct dso *dso, struct map *map,
+				      symbol_filter_t filter)
 {
 	int err;
 	const char *kallsyms_filename = NULL;
@@ -2016,7 +2023,7 @@ static int dso__load_guest_kernel_sym(struct dso *self, struct map *map,
 		 * Or use file guest_kallsyms inputted by user on commandline
 		 */
 		if (symbol_conf.default_guest_vmlinux_name != NULL) {
-			err = dso__load_vmlinux(self, map,
+			err = dso__load_vmlinux(dso, map,
 				symbol_conf.default_guest_vmlinux_name, filter);
 			goto out_try_fixup;
 		}
@@ -2029,7 +2036,7 @@ static int dso__load_guest_kernel_sym(struct dso *self, struct map *map,
 		kallsyms_filename = path;
 	}
 
-	err = dso__load_kallsyms(self, kallsyms_filename, map, filter);
+	err = dso__load_kallsyms(dso, kallsyms_filename, map, filter);
 	if (err > 0)
 		pr_debug("Using %s for symbols\n", kallsyms_filename);
 
@@ -2037,7 +2044,7 @@ out_try_fixup:
 	if (err > 0) {
 		if (kallsyms_filename != NULL) {
 			machine__mmap_name(machine, path, sizeof(path));
-			dso__set_long_name(self, strdup(path));
+			dso__set_long_name(dso, strdup(path));
 		}
 		map__fixup_start(map);
 		map__fixup_end(map);
@@ -2090,12 +2097,12 @@ size_t __dsos__fprintf(struct list_head *head, FILE *fp)
 	return ret;
 }
 
-size_t machines__fprintf_dsos(struct rb_root *self, FILE *fp)
+size_t machines__fprintf_dsos(struct rb_root *machines, FILE *fp)
 {
 	struct rb_node *nd;
 	size_t ret = 0;
 
-	for (nd = rb_first(self); nd; nd = rb_next(nd)) {
+	for (nd = rb_first(machines); nd; nd = rb_next(nd)) {
 		struct machine *pos = rb_entry(nd, struct machine, rb_node);
 		ret += __dsos__fprintf(&pos->kernel_dsos, fp);
 		ret += __dsos__fprintf(&pos->user_dsos, fp);
@@ -2119,18 +2126,20 @@ static size_t __dsos__fprintf_buildid(struct list_head *head, FILE *fp,
 	return ret;
 }
 
-size_t machine__fprintf_dsos_buildid(struct machine *self, FILE *fp, bool with_hits)
+size_t machine__fprintf_dsos_buildid(struct machine *machine, FILE *fp,
+				     bool with_hits)
 {
-	return __dsos__fprintf_buildid(&self->kernel_dsos, fp, with_hits) +
-	       __dsos__fprintf_buildid(&self->user_dsos, fp, with_hits);
+	return __dsos__fprintf_buildid(&machine->kernel_dsos, fp, with_hits) +
+	       __dsos__fprintf_buildid(&machine->user_dsos, fp, with_hits);
 }
 
-size_t machines__fprintf_dsos_buildid(struct rb_root *self, FILE *fp, bool with_hits)
+size_t machines__fprintf_dsos_buildid(struct rb_root *machines,
+				      FILE *fp, bool with_hits)
 {
 	struct rb_node *nd;
 	size_t ret = 0;
 
-	for (nd = rb_first(self); nd; nd = rb_next(nd)) {
+	for (nd = rb_first(machines); nd; nd = rb_next(nd)) {
 		struct machine *pos = rb_entry(nd, struct machine, rb_node);
 		ret += machine__fprintf_dsos_buildid(pos, fp, with_hits);
 	}
@@ -2139,59 +2148,59 @@ size_t machines__fprintf_dsos_buildid(struct rb_root *self, FILE *fp, bool with_
 
 struct dso *dso__new_kernel(const char *name)
 {
-	struct dso *self = dso__new(name ?: "[kernel.kallsyms]");
+	struct dso *dso = dso__new(name ?: "[kernel.kallsyms]");
 
-	if (self != NULL) {
-		dso__set_short_name(self, "[kernel]");
-		self->kernel = DSO_TYPE_KERNEL;
+	if (dso != NULL) {
+		dso__set_short_name(dso, "[kernel]");
+		dso->kernel = DSO_TYPE_KERNEL;
 	}
 
-	return self;
+	return dso;
 }
 
 static struct dso *dso__new_guest_kernel(struct machine *machine,
 					const char *name)
 {
 	char bf[PATH_MAX];
-	struct dso *self = dso__new(name ?: machine__mmap_name(machine, bf, sizeof(bf)));
-
-	if (self != NULL) {
-		dso__set_short_name(self, "[guest.kernel]");
-		self->kernel = DSO_TYPE_GUEST_KERNEL;
+	struct dso *dso = dso__new(name ?: machine__mmap_name(machine, bf,
+							      sizeof(bf)));
+	if (dso != NULL) {
+		dso__set_short_name(dso, "[guest.kernel]");
+		dso->kernel = DSO_TYPE_GUEST_KERNEL;
 	}
 
-	return self;
+	return dso;
 }
 
-void dso__read_running_kernel_build_id(struct dso *self, struct machine *machine)
+void dso__read_running_kernel_build_id(struct dso *dso, struct machine *machine)
 {
 	char path[PATH_MAX];
 
 	if (machine__is_default_guest(machine))
 		return;
 	sprintf(path, "%s/sys/kernel/notes", machine->root_dir);
-	if (sysfs__read_build_id(path, self->build_id,
-				 sizeof(self->build_id)) == 0)
-		self->has_build_id = true;
+	if (sysfs__read_build_id(path, dso->build_id,
+				 sizeof(dso->build_id)) == 0)
+		dso->has_build_id = true;
 }
 
-static struct dso *machine__create_kernel(struct machine *self)
+static struct dso *machine__create_kernel(struct machine *machine)
 {
 	const char *vmlinux_name = NULL;
 	struct dso *kernel;
 
-	if (machine__is_host(self)) {
+	if (machine__is_host(machine)) {
 		vmlinux_name = symbol_conf.vmlinux_name;
 		kernel = dso__new_kernel(vmlinux_name);
 	} else {
-		if (machine__is_default_guest(self))
+		if (machine__is_default_guest(machine))
 			vmlinux_name = symbol_conf.default_guest_vmlinux_name;
-		kernel = dso__new_guest_kernel(self, vmlinux_name);
+		kernel = dso__new_guest_kernel(machine, vmlinux_name);
 	}
 
 	if (kernel != NULL) {
-		dso__read_running_kernel_build_id(kernel, self);
-		dsos__add(&self->kernel_dsos, kernel);
+		dso__read_running_kernel_build_id(kernel, machine);
+		dsos__add(&machine->kernel_dsos, kernel);
 	}
 	return kernel;
 }
@@ -2236,41 +2245,43 @@ static u64 machine__get_kernel_start_addr(struct machine *machine)
 	return args.start;
 }
 
-int __machine__create_kernel_maps(struct machine *self, struct dso *kernel)
+int __machine__create_kernel_maps(struct machine *machine, struct dso *kernel)
 {
 	enum map_type type;
-	u64 start = machine__get_kernel_start_addr(self);
+	u64 start = machine__get_kernel_start_addr(machine);
 
 	for (type = 0; type < MAP__NR_TYPES; ++type) {
 		struct kmap *kmap;
 
-		self->vmlinux_maps[type] = map__new2(start, kernel, type);
-		if (self->vmlinux_maps[type] == NULL)
+		machine->vmlinux_maps[type] = map__new2(start, kernel, type);
+		if (machine->vmlinux_maps[type] == NULL)
 			return -1;
 
-		self->vmlinux_maps[type]->map_ip =
-			self->vmlinux_maps[type]->unmap_ip = identity__map_ip;
-
-		kmap = map__kmap(self->vmlinux_maps[type]);
-		kmap->kmaps = &self->kmaps;
-		map_groups__insert(&self->kmaps, self->vmlinux_maps[type]);
+		machine->vmlinux_maps[type]->map_ip =
+			machine->vmlinux_maps[type]->unmap_ip =
+				identity__map_ip;
+		kmap = map__kmap(machine->vmlinux_maps[type]);
+		kmap->kmaps = &machine->kmaps;
+		map_groups__insert(&machine->kmaps,
+				   machine->vmlinux_maps[type]);
 	}
 
 	return 0;
 }
 
-void machine__destroy_kernel_maps(struct machine *self)
+void machine__destroy_kernel_maps(struct machine *machine)
 {
 	enum map_type type;
 
 	for (type = 0; type < MAP__NR_TYPES; ++type) {
 		struct kmap *kmap;
 
-		if (self->vmlinux_maps[type] == NULL)
+		if (machine->vmlinux_maps[type] == NULL)
 			continue;
 
-		kmap = map__kmap(self->vmlinux_maps[type]);
-		map_groups__remove(&self->kmaps, self->vmlinux_maps[type]);
+		kmap = map__kmap(machine->vmlinux_maps[type]);
+		map_groups__remove(&machine->kmaps,
+				   machine->vmlinux_maps[type]);
 		if (kmap->ref_reloc_sym) {
 			/*
 			 * ref_reloc_sym is shared among all maps, so free just
@@ -2284,25 +2295,25 @@ void machine__destroy_kernel_maps(struct machine *self)
 			kmap->ref_reloc_sym = NULL;
 		}
 
-		map__delete(self->vmlinux_maps[type]);
-		self->vmlinux_maps[type] = NULL;
+		map__delete(machine->vmlinux_maps[type]);
+		machine->vmlinux_maps[type] = NULL;
 	}
 }
 
-int machine__create_kernel_maps(struct machine *self)
+int machine__create_kernel_maps(struct machine *machine)
 {
-	struct dso *kernel = machine__create_kernel(self);
+	struct dso *kernel = machine__create_kernel(machine);
 
 	if (kernel == NULL ||
-	    __machine__create_kernel_maps(self, kernel) < 0)
+	    __machine__create_kernel_maps(machine, kernel) < 0)
 		return -1;
 
-	if (symbol_conf.use_modules && machine__create_modules(self) < 0)
+	if (symbol_conf.use_modules && machine__create_modules(machine) < 0)
 		pr_debug("Problems creating module maps, continuing anyway...\n");
 	/*
 	 * Now that we have all the maps created, just set the ->end of them:
 	 */
-	map_groups__fixup_end(&self->kmaps);
+	map_groups__fixup_end(&machine->kmaps);
 	return 0;
 }
 
@@ -2366,11 +2377,11 @@ out_fail:
 	return -1;
 }
 
-size_t machine__fprintf_vmlinux_path(struct machine *self, FILE *fp)
+size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp)
 {
 	int i;
 	size_t printed = 0;
-	struct dso *kdso = self->vmlinux_maps[MAP__FUNCTION]->dso;
+	struct dso *kdso = machine->vmlinux_maps[MAP__FUNCTION]->dso;
 
 	if (kdso->has_build_id) {
 		char filename[PATH_MAX];
@@ -2467,9 +2478,9 @@ void symbol__exit(void)
 	symbol_conf.initialized = false;
 }
 
-int machines__create_kernel_maps(struct rb_root *self, pid_t pid)
+int machines__create_kernel_maps(struct rb_root *machines, pid_t pid)
 {
-	struct machine *machine = machines__findnew(self, pid);
+	struct machine *machine = machines__findnew(machines, pid);
 
 	if (machine == NULL)
 		return -1;
@@ -2520,7 +2531,7 @@ char *strxfrchar(char *s, char from, char to)
 	return s;
 }
 
-int machines__create_guest_kernel_maps(struct rb_root *self)
+int machines__create_guest_kernel_maps(struct rb_root *machines)
 {
 	int ret = 0;
 	struct dirent **namelist = NULL;
@@ -2531,7 +2542,7 @@ int machines__create_guest_kernel_maps(struct rb_root *self)
 	if (symbol_conf.default_guest_vmlinux_name ||
 	    symbol_conf.default_guest_modules ||
 	    symbol_conf.default_guest_kallsyms) {
-		machines__create_kernel_maps(self, DEFAULT_GUEST_KERNEL_ID);
+		machines__create_kernel_maps(machines, DEFAULT_GUEST_KERNEL_ID);
 	}
 
 	if (symbol_conf.guestmount) {
@@ -2552,7 +2563,7 @@ int machines__create_guest_kernel_maps(struct rb_root *self)
 				pr_debug("Can't access file %s\n", path);
 				goto failure;
 			}
-			machines__create_kernel_maps(self, pid);
+			machines__create_kernel_maps(machines, pid);
 		}
 failure:
 		free(namelist);
@@ -2561,23 +2572,23 @@ failure:
 	return ret;
 }
 
-void machines__destroy_guest_kernel_maps(struct rb_root *self)
+void machines__destroy_guest_kernel_maps(struct rb_root *machines)
 {
-	struct rb_node *next = rb_first(self);
+	struct rb_node *next = rb_first(machines);
 
 	while (next) {
 		struct machine *pos = rb_entry(next, struct machine, rb_node);
 
 		next = rb_next(&pos->rb_node);
-		rb_erase(&pos->rb_node, self);
+		rb_erase(&pos->rb_node, machines);
 		machine__delete(pos);
 	}
 }
 
-int machine__load_kallsyms(struct machine *self, const char *filename,
+int machine__load_kallsyms(struct machine *machine, const char *filename,
 			   enum map_type type, symbol_filter_t filter)
 {
-	struct map *map = self->vmlinux_maps[type];
+	struct map *map = machine->vmlinux_maps[type];
 	int ret = dso__load_kallsyms(map->dso, filename, map, filter);
 
 	if (ret > 0) {
@@ -2587,16 +2598,16 @@ int machine__load_kallsyms(struct machine *self, const char *filename,
 		 * kernel, with modules between them, fixup the end of all
 		 * sections.
 		 */
-		__map_groups__fixup_end(&self->kmaps, type);
+		__map_groups__fixup_end(&machine->kmaps, type);
 	}
 
 	return ret;
 }
 
-int machine__load_vmlinux_path(struct machine *self, enum map_type type,
+int machine__load_vmlinux_path(struct machine *machine, enum map_type type,
 			       symbol_filter_t filter)
 {
-	struct map *map = self->vmlinux_maps[type];
+	struct map *map = machine->vmlinux_maps[type];
 	int ret = dso__load_vmlinux_path(map->dso, map, filter);
 
 	if (ret > 0) {
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 713b0b4..242de01 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -62,7 +62,7 @@ struct symbol {
 	char		name[0];
 };
 
-void symbol__delete(struct symbol *self);
+void symbol__delete(struct symbol *sym);
 
 struct strlist;
 
@@ -96,9 +96,9 @@ struct symbol_conf {
 
 extern struct symbol_conf symbol_conf;
 
-static inline void *symbol__priv(struct symbol *self)
+static inline void *symbol__priv(struct symbol *sym)
 {
-	return ((void *)self) - symbol_conf.priv_size;
+	return ((void *)sym) - symbol_conf.priv_size;
 }
 
 struct ref_reloc_sym {
@@ -155,43 +155,45 @@ struct dso {
 
 struct dso *dso__new(const char *name);
 struct dso *dso__new_kernel(const char *name);
-void dso__delete(struct dso *self);
+void dso__delete(struct dso *dso);
 
-int dso__name_len(const struct dso *self);
+int dso__name_len(const struct dso *dso);
 
-bool dso__loaded(const struct dso *self, enum map_type type);
-bool dso__sorted_by_name(const struct dso *self, enum map_type type);
+bool dso__loaded(const struct dso *dso, enum map_type type);
+bool dso__sorted_by_name(const struct dso *dso, enum map_type type);
 
-static inline void dso__set_loaded(struct dso *self, enum map_type type)
+static inline void dso__set_loaded(struct dso *dso, enum map_type type)
 {
-	self->loaded |= (1 << type);
+	dso->loaded |= (1 << type);
 }
 
-void dso__sort_by_name(struct dso *self, enum map_type type);
+void dso__sort_by_name(struct dso *dso, enum map_type type);
 
 struct dso *__dsos__findnew(struct list_head *head, const char *name);
 
-int dso__load(struct dso *self, struct map *map, symbol_filter_t filter);
-int dso__load_vmlinux(struct dso *self, struct map *map,
+int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter);
+int dso__load_vmlinux(struct dso *dso, struct map *map,
 		      const char *vmlinux, symbol_filter_t filter);
-int dso__load_vmlinux_path(struct dso *self, struct map *map,
+int dso__load_vmlinux_path(struct dso *dso, struct map *map,
 			   symbol_filter_t filter);
-int dso__load_kallsyms(struct dso *self, const char *filename, struct map *map,
+int dso__load_kallsyms(struct dso *dso, const char *filename, struct map *map,
 		       symbol_filter_t filter);
-int machine__load_kallsyms(struct machine *self, const char *filename,
+int machine__load_kallsyms(struct machine *machine, const char *filename,
 			   enum map_type type, symbol_filter_t filter);
-int machine__load_vmlinux_path(struct machine *self, enum map_type type,
+int machine__load_vmlinux_path(struct machine *machine, enum map_type type,
 			       symbol_filter_t filter);
 
 size_t __dsos__fprintf(struct list_head *head, FILE *fp);
 
-size_t machine__fprintf_dsos_buildid(struct machine *self, FILE *fp, bool with_hits);
-size_t machines__fprintf_dsos(struct rb_root *self, FILE *fp);
-size_t machines__fprintf_dsos_buildid(struct rb_root *self, FILE *fp, bool with_hits);
-
-size_t dso__fprintf_buildid(struct dso *self, FILE *fp);
-size_t dso__fprintf_symbols_by_name(struct dso *self, enum map_type type, FILE *fp);
-size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp);
+size_t machine__fprintf_dsos_buildid(struct machine *machine,
+				     FILE *fp, bool with_hits);
+size_t machines__fprintf_dsos(struct rb_root *machines, FILE *fp);
+size_t machines__fprintf_dsos_buildid(struct rb_root *machines,
+				      FILE *fp, bool with_hits);
+size_t dso__fprintf_buildid(struct dso *dso, FILE *fp);
+size_t dso__fprintf_symbols_by_name(struct dso *dso,
+				    enum map_type type, FILE *fp);
+size_t dso__fprintf(struct dso *dso, enum map_type type, FILE *fp);
 
 enum symtab_type {
 	SYMTAB__KALLSYMS = 0,
@@ -207,34 +209,36 @@ enum symtab_type {
 	SYMTAB__NOT_FOUND,
 };
 
-char dso__symtab_origin(const struct dso *self);
-void dso__set_long_name(struct dso *self, char *name);
-void dso__set_build_id(struct dso *self, void *build_id);
-void dso__read_running_kernel_build_id(struct dso *self, struct machine *machine);
-struct symbol *dso__find_symbol(struct dso *self, enum map_type type, u64 addr);
-struct symbol *dso__find_symbol_by_name(struct dso *self, enum map_type type,
+char dso__symtab_origin(const struct dso *dso);
+void dso__set_long_name(struct dso *dso, char *name);
+void dso__set_build_id(struct dso *dso, void *build_id);
+void dso__read_running_kernel_build_id(struct dso *dso,
+				       struct machine *machine);
+struct symbol *dso__find_symbol(struct dso *dso, enum map_type type,
+				u64 addr);
+struct symbol *dso__find_symbol_by_name(struct dso *dso, enum map_type type,
 					const char *name);
 
 int filename__read_build_id(const char *filename, void *bf, size_t size);
 int sysfs__read_build_id(const char *filename, void *bf, size_t size);
 bool __dsos__read_build_ids(struct list_head *head, bool with_hits);
-int build_id__sprintf(const u8 *self, int len, char *bf);
+int build_id__sprintf(const u8 *build_id, int len, char *bf);
 int kallsyms__parse(const char *filename, void *arg,
 		    int (*process_symbol)(void *arg, const char *name,
 					  char type, u64 start, u64 end));
 
-void machine__destroy_kernel_maps(struct machine *self);
-int __machine__create_kernel_maps(struct machine *self, struct dso *kernel);
-int machine__create_kernel_maps(struct machine *self);
+void machine__destroy_kernel_maps(struct machine *machine);
+int __machine__create_kernel_maps(struct machine *machine, struct dso *kernel);
+int machine__create_kernel_maps(struct machine *machine);
 
-int machines__create_kernel_maps(struct rb_root *self, pid_t pid);
-int machines__create_guest_kernel_maps(struct rb_root *self);
-void machines__destroy_guest_kernel_maps(struct rb_root *self);
+int machines__create_kernel_maps(struct rb_root *machines, pid_t pid);
+int machines__create_guest_kernel_maps(struct rb_root *machines);
+void machines__destroy_guest_kernel_maps(struct rb_root *machines);
 
 int symbol__init(void);
 void symbol__exit(void);
 bool symbol_type__is_a(char symbol_type, enum map_type map_type);
 
-size_t machine__fprintf_vmlinux_path(struct machine *self, FILE *fp);
+size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp);
 
 #endif /* __PERF_SYMBOL */
-- 
1.6.2.5


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 2/6] perf tools: Makefile: Clean up `python/perf.so' rule
  2011-04-20 16:23 [GIT PULL 0/6] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2011-04-20 16:23 ` [PATCH 1/6] perf symbols: Give more useful names to 'self' parameters Arnaldo Carvalho de Melo
@ 2011-04-20 16:23 ` Arnaldo Carvalho de Melo
  2011-04-20 16:23 ` [PATCH 3/6] perf tools: Makefile: PYTHON{,_CONFIG} to bandage Python 3 incompatibility Arnaldo Carvalho de Melo
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-04-20 16:23 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Michael Witten, Arnaldo Carvalho de Melo

From: Michael Witten <mfwitten@gmail.com>

There is no need for a subshell or an explicit `export';
as per the POSIX Shell Command Language specification:

  http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_09_01
  http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_10_02

It is only necessary to include the environment variable
assignment just before the command to be run.

Also, it is better to use single-quotes, because GNU make
might expand `$(BASIC_CFLAGS)' into something that the shell
could interpret within double-quotes.

Acked-by: Raghavendra D Prabhu <rprabhu@wnohang.net>
Link: http://lkml.kernel.org/n/tip-58n38o02ocuzrm9qh096hsf5@git.kernel.org
Signed-off-by: Michael Witten <mfwitten@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 207dee5..aaf4dd3 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -165,12 +165,10 @@ grep-libs = $(filter -l%,$(1))
 strip-libs = $(filter-out -l%,$(1))
 
 $(OUTPUT)python/perf.so: $(PYRF_OBJS)
-	$(QUIET_GEN)( \
-		export CFLAGS="$(BASIC_CFLAGS)"; \
-		python util/setup.py --quiet  build_ext --build-lib='$(OUTPUT)python' \
-			--build-temp='$(OUTPUT)python/temp' \
-	)
-
+	$(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' python util/setup.py \
+	  --quiet build_ext \
+	  --build-lib='$(OUTPUT)python' \
+	  --build-temp='$(OUTPUT)python/temp'
 #
 # No Perl scripts right now:
 #
-- 
1.6.2.5


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 3/6] perf tools: Makefile: PYTHON{,_CONFIG} to bandage Python 3 incompatibility
  2011-04-20 16:23 [GIT PULL 0/6] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2011-04-20 16:23 ` [PATCH 1/6] perf symbols: Give more useful names to 'self' parameters Arnaldo Carvalho de Melo
  2011-04-20 16:23 ` [PATCH 2/6] perf tools: Makefile: Clean up `python/perf.so' rule Arnaldo Carvalho de Melo
@ 2011-04-20 16:23 ` Arnaldo Carvalho de Melo
  2011-04-20 16:23 ` [PATCH 4/6] perf tools: Move `try-cc' Arnaldo Carvalho de Melo
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-04-20 16:23 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Michael Witten, Arnaldo Carvalho de Melo

From: Michael Witten <mfwitten@gmail.com>

Currently, Python 3 is not supported by perf's code; this
can cause the build to fail for systems that have Python 3
installed as the default python:

  python{,-config}

The Correct Solution is to write compatibility code so that
Python 3 works out-of-the-box.

However, users often have an ancillary Python 2 installed:

  python2{,-config}

Therefore, a quick fix is to allow the user to specify those
ancillary paths as the python binaries that Makefile should
use, thereby avoiding Python 3 altogether; as an added benefit,
the Python binaries may be installed in non-standard locations
without the need for updating any PATH variable.

This commit adds the ability to set PYTHON and/or PYTHON_CONFIG
either as environment variables or as make variables on the
command line; the paths may be relative, and usually only PYTHON
is necessary in order for PYTHON_CONFIG to be defined implicitly.
Some rudimentary error checking is performed when the user
explicitly specifies a value for any of these variables.

In addition, this commit introduces significantly robust makefile
infrastructure for working with paths and communicating with the
shell; it's currently only used for handling Python, but I hope
it will prove useful in refactoring the makefiles.

Thanks to:

  Raghavendra D Prabhu <rprabhu@wnohang.net>

for motivating this patch.

Acked-by: Raghavendra D Prabhu <rprabhu@wnohang.net>
Link: http://lkml.kernel.org/r/e987828e-87ec-4973-95e7-47f10f5d9bab-mfwitten@gmail.com
Signed-off-by: Michael Witten <mfwitten@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile             |   97 +++++++++++++++++-----
 tools/perf/config/utilities.mak |  180 +++++++++++++++++++++++++++++++++++++++
 tools/perf/feature-tests.mak    |    8 ++-
 3 files changed, 264 insertions(+), 21 deletions(-)
 create mode 100644 tools/perf/config/utilities.mak

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index aaf4dd3..b5276c7 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -5,6 +5,8 @@ endif
 # The default target of this Makefile is...
 all:
 
+include config/utilities.mak
+
 ifneq ($(OUTPUT),)
 # check that the output directory actually exists
 OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
@@ -13,6 +15,12 @@ endif
 
 # Define V to have a more verbose compile.
 #
+# Define PYTHON to point to the python binary if the default
+# `python' is not correct; for example: PYTHON=python2
+#
+# Define PYTHON_CONFIG to point to the python-config binary if
+# the default `$(PYTHON)-config' is not correct.
+#
 # Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8
 #
 # Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72.
@@ -165,7 +173,7 @@ grep-libs = $(filter -l%,$(1))
 strip-libs = $(filter-out -l%,$(1))
 
 $(OUTPUT)python/perf.so: $(PYRF_OBJS)
-	$(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' python util/setup.py \
+	$(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \
 	  --quiet build_ext \
 	  --build-lib='$(OUTPUT)python' \
 	  --build-temp='$(OUTPUT)python/temp'
@@ -473,24 +481,74 @@ else
 	endif
 endif
 
-ifdef NO_LIBPYTHON
-	BASIC_CFLAGS += -DNO_LIBPYTHON
+disable-python = $(eval $(disable-python_code))
+define disable-python_code
+  BASIC_CFLAGS += -DNO_LIBPYTHON
+  $(if $(1),$(warning No $(1) was found))
+  $(warning Python support won't be built)
+endef
+
+override PYTHON := \
+  $(call get-executable-or-default,PYTHON,python)
+
+ifndef PYTHON
+  $(call disable-python,python interpreter)
+  python-clean :=
 else
-       PYTHON_EMBED_LDOPTS = $(shell python-config --ldflags 2>/dev/null)
-       PYTHON_EMBED_LDFLAGS = $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
-       PYTHON_EMBED_LIBADD = $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
-	PYTHON_EMBED_CCOPTS = `python-config --cflags 2>/dev/null`
-	FLAGS_PYTHON_EMBED=$(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
-	ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED)),y)
-		msg := $(warning No Python.h found, install python-dev[el] to have python support in 'perf script' and to build the python bindings)
-		BASIC_CFLAGS += -DNO_LIBPYTHON
-	else
-               ALL_LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
-               EXTLIBS += $(PYTHON_EMBED_LIBADD)
-		LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
-		LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
-		LANG_BINDINGS += $(OUTPUT)python/perf.so
-	endif
+
+  PYTHON_WORD := $(call shell-wordify,$(PYTHON))
+
+  python-clean := $(PYTHON_WORD) util/setup.py clean \
+    --build-lib='$(OUTPUT)python' \
+    --build-temp='$(OUTPUT)python/temp'
+
+  ifdef NO_LIBPYTHON
+    $(call disable-python)
+  else
+
+    override PYTHON_CONFIG := \
+      $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)
+
+    ifndef PYTHON_CONFIG
+      $(call disable-python,python-config tool)
+    else
+
+      PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
+
+      PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
+      PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
+      PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
+      PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
+      FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
+
+      ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED)),y)
+        $(call disable-python,Python.h (for Python 2.x))
+      else
+
+        ifneq ($(call try-cc,$(SOURCE_PYTHON_VERSION),$(FLAGS_PYTHON_EMBED)),y)
+          $(warning Python 3 is not yet supported; please set)
+          $(warning PYTHON and/or PYTHON_CONFIG appropriately.)
+          $(warning If you also have Python 2 installed, then)
+          $(warning try something like:)
+          $(warning $(and ,))
+          $(warning $(and ,)  make PYTHON=python2)
+          $(warning $(and ,))
+          $(warning Otherwise, disable Python support entirely:)
+          $(warning $(and ,))
+          $(warning $(and ,)  make NO_LIBPYTHON=1)
+          $(warning $(and ,))
+          $(error   $(and ,))
+        else
+          ALL_LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
+          EXTLIBS += $(PYTHON_EMBED_LIBADD)
+          LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
+          LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
+          LANG_BINDINGS += $(OUTPUT)python/perf.so
+        endif
+
+      endif
+    endif
+  endif
 endif
 
 ifdef NO_DEMANGLE
@@ -831,8 +889,7 @@ clean:
 	$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope*
 	$(MAKE) -C Documentation/ clean
 	$(RM) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS
-	@python util/setup.py clean --build-lib='$(OUTPUT)python' \
-				   --build-temp='$(OUTPUT)python/temp'
+	$(python-clean)
 
 .PHONY: all install clean strip
 .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
diff --git a/tools/perf/config/utilities.mak b/tools/perf/config/utilities.mak
new file mode 100644
index 0000000..6d8ff88
--- /dev/null
+++ b/tools/perf/config/utilities.mak
@@ -0,0 +1,180 @@
+# This allows us to work with the newline character:
+define newline
+
+
+endef
+newline := $(newline)
+
+# nl-escape
+#
+# Usage: escape = $(call nl-escape[,escape])
+#
+# This is used as the common way to specify
+# what should replace a newline when escaping
+# newlines; the default is a bizarre string.
+#
+nl-escape = $(or $(1),m822df3020w6a44id34bt574ctac44eb9f4n)
+
+# escape-nl
+#
+# Usage: escaped-text = $(call escape-nl,text[,escape])
+#
+# GNU make's $(shell ...) function converts to a
+# single space each newline character in the output
+# produced during the expansion; this may not be
+# desirable.
+#
+# The only solution is to change each newline into
+# something that won't be converted, so that the
+# information can be recovered later with
+# $(call unescape-nl...)
+#
+escape-nl = $(subst $(newline),$(call nl-escape,$(2)),$(1))
+
+# unescape-nl
+#
+# Usage: text = $(call unescape-nl,escaped-text[,escape])
+#
+# See escape-nl.
+#
+unescape-nl = $(subst $(call nl-escape,$(2)),$(newline),$(1))
+
+# shell-escape-nl
+#
+# Usage: $(shell some-command | $(call shell-escape-nl[,escape]))
+#
+# Use this to escape newlines from within a shell call;
+# the default escape is a bizarre string.
+#
+# NOTE: The escape is used directly as a string constant
+#       in an `awk' program that is delimited by shell
+#       single-quotes, so be wary of the characters
+#       that are chosen.
+#
+define shell-escape-nl
+awk 'NR==1 {t=$$0} NR>1 {t=t "$(nl-escape)" $$0} END {printf t}'
+endef
+
+# shell-unescape-nl
+#
+# Usage: $(shell some-command | $(call shell-unescape-nl[,escape]))
+#
+# Use this to unescape newlines from within a shell call;
+# the default escape is a bizarre string.
+#
+# NOTE: The escape is used directly as an extended regular
+#       expression constant in an `awk' program that is
+#       delimited by shell single-quotes, so be wary
+#       of the characters that are chosen.
+#
+# (The bash shell has a bug where `{gsub(...),...}' is
+#  misinterpreted as a brace expansion; this can be
+#  overcome by putting a space between `{' and `gsub').
+#
+define shell-unescape-nl
+awk 'NR==1 {t=$$0} NR>1 {t=t "\n" $$0} END { gsub(/$(nl-escape)/,"\n",t); printf t }'
+endef
+
+# escape-for-shell-sq
+#
+# Usage: embeddable-text = $(call escape-for-shell-sq,text)
+#
+# This function produces text that is suitable for
+# embedding in a shell string that is delimited by
+# single-quotes.
+#
+escape-for-shell-sq =  $(subst ','\'',$(1))
+
+# shell-sq
+#
+# Usage: single-quoted-and-escaped-text = $(call shell-sq,text)
+#
+shell-sq = '$(escape-for-shell-sq)'
+
+# shell-wordify
+#
+# Usage: wordified-text = $(call shell-wordify,text)
+#
+# For instance:
+#
+#  |define text
+#  |hello
+#  |world
+#  |endef
+#  |
+#  |target:
+#  |	echo $(call shell-wordify,$(text))
+#
+# At least GNU make gets confused by expanding a newline
+# within the context of a command line of a makefile rule
+# (this is in constrast to a `$(shell ...)' function call,
+# which can handle it just fine).
+#
+# This function avoids the problem by producing a string
+# that works as a shell word, regardless of whether or
+# not it contains a newline.
+#
+# If the text to be wordified contains a newline, then
+# an intrictate shell command substitution is constructed
+# to render the text as a single line; when the shell
+# processes the resulting escaped text, it transforms
+# it into the original unescaped text.
+#
+# If the text does not contain a newline, then this function
+# produces the same results as the `$(shell-sq)' function.
+#
+shell-wordify = $(if $(findstring $(newline),$(1)),$(_sw-esc-nl),$(shell-sq))
+define _sw-esc-nl
+"$$(echo $(call escape-nl,$(shell-sq),$(2)) | $(call shell-unescape-nl,$(2)))"
+endef
+
+# is-absolute
+#
+# Usage: bool-value = $(call is-absolute,path)
+#
+is-absolute = $(shell echo $(shell-sq) | grep ^/ -q && echo y)
+
+# lookup
+#
+# Usage: absolute-executable-path-or-empty = $(call lookup,path)
+#
+# (It's necessary to use `sh -c' because GNU make messes up by
+#  trying too hard and getting things wrong).
+#
+lookup = $(call unescape-nl,$(shell sh -c $(_l-sh)))
+_l-sh = $(call shell-sq,command -v $(shell-sq) | $(call shell-escape-nl,))
+
+# is-executable
+#
+# Usage: bool-value = $(call is-executable,path)
+#
+# (It's necessary to use `sh -c' because GNU make messes up by
+#  trying too hard and getting things wrong).
+#
+is-executable = $(call _is-executable-helper,$(shell-sq))
+_is-executable-helper = $(shell sh -c $(_is-executable-sh))
+_is-executable-sh = $(call shell-sq,test -f $(1) -a -x $(1) && echo y)
+
+# get-executable
+#
+# Usage: absolute-executable-path-or-empty = $(call get-executable,path)
+#
+# The goal is to get an absolute path for an executable;
+# the `command -v' is defined by POSIX, but it's not
+# necessarily very portable, so it's only used if
+# relative path resolution is requested, as determined
+# by the presence of a leading `/'.
+#
+get-executable = $(if $(1),$(if $(is-absolute),$(_ge-abspath),$(lookup)))
+_ge-abspath = $(if $(is-executable),$(1))
+
+# get-supplied-or-default-executable
+#
+# Usage: absolute-executable-path-or-empty = $(call get-executable-or-default,variable,default)
+#
+define get-executable-or-default
+$(if $($(1)),$(call _ge_attempt,$($(1)),$(1)),$(call _ge_attempt,$(2)))
+endef
+_ge_attempt = $(or $(get-executable),$(_gea_warn),$(call _gea_err,$(2)))
+_gea_warn = $(warning The path '$(1)' is not executable.)
+_gea_err  = $(if $(1),$(error Please set '$(1)' appropriately))
diff --git a/tools/perf/feature-tests.mak b/tools/perf/feature-tests.mak
index b041ca6..1b33420 100644
--- a/tools/perf/feature-tests.mak
+++ b/tools/perf/feature-tests.mak
@@ -79,9 +79,15 @@ endef
 endif
 
 ifndef NO_LIBPYTHON
+define SOURCE_PYTHON_VERSION
+#include <Python.h>
+#if PY_VERSION_HEX >= 0x03000000
+	#error
+#endif
+int main(void){}
+endef
 define SOURCE_PYTHON_EMBED
 #include <Python.h>
-
 int main(void)
 {
 	Py_Initialize();
-- 
1.6.2.5


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 4/6] perf tools: Move `try-cc'
  2011-04-20 16:23 [GIT PULL 0/6] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2011-04-20 16:23 ` [PATCH 3/6] perf tools: Makefile: PYTHON{,_CONFIG} to bandage Python 3 incompatibility Arnaldo Carvalho de Melo
@ 2011-04-20 16:23 ` Arnaldo Carvalho de Melo
  2011-04-20 16:23 ` [PATCH 5/6] perf tools: git mv tools/perf/{features-tests.mak,config/} Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-04-20 16:23 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Michael Witten, Arnaldo Carvalho de Melo

From: Michael Witten <mfwitten@gmail.com>

The `try-cc' user-defined function was in tools/perf/feature-tests.mak;
this commit moves it to tools/perf/config/utilities.mak.

Signed-off-by: Michael Witten <mfwitten@gmail.com>
Link: http://lkml.kernel.org/n/tip-bqhwcuxsrve0iodn6q4ejaoi@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/config/utilities.mak |    8 ++++++++
 tools/perf/feature-tests.mak    |    8 --------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/perf/config/utilities.mak b/tools/perf/config/utilities.mak
index 6d8ff88..8046182 100644
--- a/tools/perf/config/utilities.mak
+++ b/tools/perf/config/utilities.mak
@@ -178,3 +178,11 @@ endef
 _ge_attempt = $(or $(get-executable),$(_gea_warn),$(call _gea_err,$(2)))
 _gea_warn = $(warning The path '$(1)' is not executable.)
 _gea_err  = $(if $(1),$(error Please set '$(1)' appropriately))
+
+# try-cc
+# Usage: option = $(call try-cc, source-to-build, cc-options)
+try-cc = $(shell sh -c						  \
+	'TMP="$(OUTPUT)$(TMPOUT).$$$$";				  \
+	 echo "$(1)" |						  \
+	 $(CC) -x c - $(2) -o "$$TMP" > /dev/null 2>&1 && echo y; \
+	 rm -f "$$TMP"')
diff --git a/tools/perf/feature-tests.mak b/tools/perf/feature-tests.mak
index 1b33420..6170fd2 100644
--- a/tools/perf/feature-tests.mak
+++ b/tools/perf/feature-tests.mak
@@ -126,11 +126,3 @@ int main(void)
 	return 0;
 }
 endef
-
-# try-cc
-# Usage: option = $(call try-cc, source-to-build, cc-options)
-try-cc = $(shell sh -c						  \
-	'TMP="$(OUTPUT)$(TMPOUT).$$$$";				  \
-	 echo "$(1)" |						  \
-	 $(CC) -x c - $(2) -o "$$TMP" > /dev/null 2>&1 && echo y; \
-	 rm -f "$$TMP"')
-- 
1.6.2.5


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 5/6] perf tools: git mv tools/perf/{features-tests.mak,config/}
  2011-04-20 16:23 [GIT PULL 0/6] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (3 preceding siblings ...)
  2011-04-20 16:23 ` [PATCH 4/6] perf tools: Move `try-cc' Arnaldo Carvalho de Melo
@ 2011-04-20 16:23 ` Arnaldo Carvalho de Melo
  2011-04-20 16:23 ` [PATCH 6/6] perf script: Add support for PERF_TYPE_RAW Arnaldo Carvalho de Melo
  2011-04-21  8:58 ` [GIT PULL 0/6] perf/core improvements and fixes Ingo Molnar
  6 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-04-20 16:23 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Michael Witten, Arnaldo Carvalho de Melo

From: Michael Witten <mfwitten@gmail.com>

Signed-off-by: Michael Witten <mfwitten@gmail.com>
Link: http://lkml.kernel.org/n/tip-a6zhefjayuounko1tk5sjji2@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile                 |    2 +-
 tools/perf/config/feature-tests.mak |  128 +++++++++++++++++++++++++++++++++++
 tools/perf/feature-tests.mak        |  128 -----------------------------------
 3 files changed, 129 insertions(+), 129 deletions(-)
 create mode 100644 tools/perf/config/feature-tests.mak
 delete mode 100644 tools/perf/feature-tests.mak

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index b5276c7..91ad5cc 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -138,7 +138,7 @@ INSTALL = install
 # explicitly what architecture to check for. Fix this up for yours..
 SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
 
--include feature-tests.mak
+-include config/feature-tests.mak
 
 ifeq ($(call try-cc,$(SOURCE_HELLO),-Werror -fstack-protector-all),y)
 	CFLAGS := $(CFLAGS) -fstack-protector-all
diff --git a/tools/perf/config/feature-tests.mak b/tools/perf/config/feature-tests.mak
new file mode 100644
index 0000000..6170fd2
--- /dev/null
+++ b/tools/perf/config/feature-tests.mak
@@ -0,0 +1,128 @@
+define SOURCE_HELLO
+#include <stdio.h>
+int main(void)
+{
+	return puts(\"hi\");
+}
+endef
+
+ifndef NO_DWARF
+define SOURCE_DWARF
+#include <dwarf.h>
+#include <elfutils/libdw.h>
+#include <elfutils/version.h>
+#ifndef _ELFUTILS_PREREQ
+#error
+#endif
+
+int main(void)
+{
+	Dwarf *dbg = dwarf_begin(0, DWARF_C_READ);
+	return (long)dbg;
+}
+endef
+endif
+
+define SOURCE_LIBELF
+#include <libelf.h>
+
+int main(void)
+{
+	Elf *elf = elf_begin(0, ELF_C_READ, 0);
+	return (long)elf;
+}
+endef
+
+define SOURCE_GLIBC
+#include <gnu/libc-version.h>
+
+int main(void)
+{
+	const char *version = gnu_get_libc_version();
+	return (long)version;
+}
+endef
+
+define SOURCE_ELF_MMAP
+#include <libelf.h>
+int main(void)
+{
+	Elf *elf = elf_begin(0, ELF_C_READ_MMAP, 0);
+	return (long)elf;
+}
+endef
+
+ifndef NO_NEWT
+define SOURCE_NEWT
+#include <newt.h>
+
+int main(void)
+{
+	newtInit();
+	newtCls();
+	return newtFinished();
+}
+endef
+endif
+
+ifndef NO_LIBPERL
+define SOURCE_PERL_EMBED
+#include <EXTERN.h>
+#include <perl.h>
+
+int main(void)
+{
+perl_alloc();
+return 0;
+}
+endef
+endif
+
+ifndef NO_LIBPYTHON
+define SOURCE_PYTHON_VERSION
+#include <Python.h>
+#if PY_VERSION_HEX >= 0x03000000
+	#error
+#endif
+int main(void){}
+endef
+define SOURCE_PYTHON_EMBED
+#include <Python.h>
+int main(void)
+{
+	Py_Initialize();
+	return 0;
+}
+endef
+endif
+
+define SOURCE_BFD
+#include <bfd.h>
+
+int main(void)
+{
+	bfd_demangle(0, 0, 0);
+	return 0;
+}
+endef
+
+define SOURCE_CPLUS_DEMANGLE
+extern char *cplus_demangle(const char *, int);
+
+int main(void)
+{
+	cplus_demangle(0, 0);
+	return 0;
+}
+endef
+
+define SOURCE_STRLCPY
+#include <stdlib.h>
+extern size_t strlcpy(char *dest, const char *src, size_t size);
+
+int main(void)
+{
+	strlcpy(NULL, NULL, 0);
+	return 0;
+}
+endef
diff --git a/tools/perf/feature-tests.mak b/tools/perf/feature-tests.mak
deleted file mode 100644
index 6170fd2..0000000
--- a/tools/perf/feature-tests.mak
+++ /dev/null
@@ -1,128 +0,0 @@
-define SOURCE_HELLO
-#include <stdio.h>
-int main(void)
-{
-	return puts(\"hi\");
-}
-endef
-
-ifndef NO_DWARF
-define SOURCE_DWARF
-#include <dwarf.h>
-#include <elfutils/libdw.h>
-#include <elfutils/version.h>
-#ifndef _ELFUTILS_PREREQ
-#error
-#endif
-
-int main(void)
-{
-	Dwarf *dbg = dwarf_begin(0, DWARF_C_READ);
-	return (long)dbg;
-}
-endef
-endif
-
-define SOURCE_LIBELF
-#include <libelf.h>
-
-int main(void)
-{
-	Elf *elf = elf_begin(0, ELF_C_READ, 0);
-	return (long)elf;
-}
-endef
-
-define SOURCE_GLIBC
-#include <gnu/libc-version.h>
-
-int main(void)
-{
-	const char *version = gnu_get_libc_version();
-	return (long)version;
-}
-endef
-
-define SOURCE_ELF_MMAP
-#include <libelf.h>
-int main(void)
-{
-	Elf *elf = elf_begin(0, ELF_C_READ_MMAP, 0);
-	return (long)elf;
-}
-endef
-
-ifndef NO_NEWT
-define SOURCE_NEWT
-#include <newt.h>
-
-int main(void)
-{
-	newtInit();
-	newtCls();
-	return newtFinished();
-}
-endef
-endif
-
-ifndef NO_LIBPERL
-define SOURCE_PERL_EMBED
-#include <EXTERN.h>
-#include <perl.h>
-
-int main(void)
-{
-perl_alloc();
-return 0;
-}
-endef
-endif
-
-ifndef NO_LIBPYTHON
-define SOURCE_PYTHON_VERSION
-#include <Python.h>
-#if PY_VERSION_HEX >= 0x03000000
-	#error
-#endif
-int main(void){}
-endef
-define SOURCE_PYTHON_EMBED
-#include <Python.h>
-int main(void)
-{
-	Py_Initialize();
-	return 0;
-}
-endef
-endif
-
-define SOURCE_BFD
-#include <bfd.h>
-
-int main(void)
-{
-	bfd_demangle(0, 0, 0);
-	return 0;
-}
-endef
-
-define SOURCE_CPLUS_DEMANGLE
-extern char *cplus_demangle(const char *, int);
-
-int main(void)
-{
-	cplus_demangle(0, 0);
-	return 0;
-}
-endef
-
-define SOURCE_STRLCPY
-#include <stdlib.h>
-extern size_t strlcpy(char *dest, const char *src, size_t size);
-
-int main(void)
-{
-	strlcpy(NULL, NULL, 0);
-	return 0;
-}
-endef
-- 
1.6.2.5


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 6/6] perf script: Add support for PERF_TYPE_RAW
  2011-04-20 16:23 [GIT PULL 0/6] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (4 preceding siblings ...)
  2011-04-20 16:23 ` [PATCH 5/6] perf tools: git mv tools/perf/{features-tests.mak,config/} Arnaldo Carvalho de Melo
@ 2011-04-20 16:23 ` Arnaldo Carvalho de Melo
  2011-04-21  8:58 ` [GIT PULL 0/6] perf/core improvements and fixes Ingo Molnar
  6 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-04-20 16:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arun Sharma, Frederic Weisbecker, Ingo Molnar,
	Mike Galbraith, Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	Thomas Gleixner, Tom Zanussi, Arnaldo Carvalho de Melo

From: Arun Sharma <asharma@fb.com>

Useful for getting stack traces for hardware events not handled by
PERF_TYPE_HARDWARE.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: Arun Sharma <asharma@fb.com>
Link: http://lkml.kernel.org/n/tip-qimdcdpekjqxuyqovy4kjusx@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-script.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 6cf811a..b3012c4 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -82,6 +82,16 @@ static struct {
 				  PERF_OUTPUT_CPU | PERF_OUTPUT_TIME |
 				  PERF_OUTPUT_EVNAME | PERF_OUTPUT_TRACE,
 	},
+
+	[PERF_TYPE_RAW] = {
+		.user_set = false,
+
+		.fields = PERF_OUTPUT_COMM | PERF_OUTPUT_TID |
+			      PERF_OUTPUT_CPU | PERF_OUTPUT_TIME |
+			      PERF_OUTPUT_EVNAME | PERF_OUTPUT_SYM,
+
+		.invalid_fields = PERF_OUTPUT_TRACE,
+	},
 };
 
 static bool output_set_by_user(void)
@@ -502,6 +512,8 @@ static int parse_output_fields(const struct option *opt __used,
 			type = PERF_TYPE_SOFTWARE;
 		else if (!strcmp(str, "trace"))
 			type = PERF_TYPE_TRACEPOINT;
+		else if (!strcmp(str, "raw"))
+			type = PERF_TYPE_RAW;
 		else {
 			fprintf(stderr, "Invalid event type in field string.\n");
 			return -EINVAL;
@@ -902,7 +914,7 @@ static const struct option options[] = {
 	OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory",
 		    "Look for files with symbols relative to this directory"),
 	OPT_CALLBACK('f', "fields", NULL, "str",
-		     "comma separated output fields prepend with 'type:'. Valid types: hw,sw,trace. Fields: comm,tid,pid,time,cpu,event,trace,sym",
+		     "comma separated output fields prepend with 'type:'. Valid types: hw,sw,trace,raw. Fields: comm,tid,pid,time,cpu,event,trace,sym",
 		     parse_output_fields),
 
 	OPT_END()
-- 
1.6.2.5


^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2011-04-20 16:23 [GIT PULL 0/6] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (5 preceding siblings ...)
  2011-04-20 16:23 ` [PATCH 6/6] perf script: Add support for PERF_TYPE_RAW Arnaldo Carvalho de Melo
@ 2011-04-21  8:58 ` Ingo Molnar
  6 siblings, 0 replies; 40+ messages in thread
From: Ingo Molnar @ 2011-04-21  8:58 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Arun Sharma, Frederic Weisbecker, Michael Witten,
	Mike Galbraith, Paul Mackerras, Peter Zijlstra,
	Raghavendra D Prabhu, Stephane Eranian, Thomas Gleixner,
	Tom Zanussi, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:

> Hi Ingo,
> 
>         Please consider pulling from:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf/core
> 
> Regards,
> 
> - Arnaldo
> 
> Arnaldo Carvalho de Melo (1):
>   perf symbols: Give more useful names to 'self' parameters
> 
> Arun Sharma (1):
>   perf script: Add support for PERF_TYPE_RAW
> 
> Michael Witten (4):
>   perf tools: Makefile: Clean up `python/perf.so' rule
>   perf tools: Makefile: PYTHON{,_CONFIG} to bandage Python 3 incompatibility
>   perf tools: Move `try-cc'
>   perf tools: git mv tools/perf/{features-tests.mak,config/}
> 
>  tools/perf/Makefile                 |  107 +++++--
>  tools/perf/builtin-script.c         |   14 +-
>  tools/perf/config/feature-tests.mak |  128 +++++++
>  tools/perf/config/utilities.mak     |  188 +++++++++++
>  tools/perf/feature-tests.mak        |  130 -------
>  tools/perf/util/symbol.c            |  629 ++++++++++++++++++-----------------
>  tools/perf/util/symbol.h            |   78 +++--
>  7 files changed, 771 insertions(+), 503 deletions(-)
>  create mode 100644 tools/perf/config/feature-tests.mak
>  create mode 100644 tools/perf/config/utilities.mak
>  delete mode 100644 tools/perf/feature-tests.mak

Pulled, thanks a lot Arnaldo!

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2017-03-16 16:09 Arnaldo Carvalho de Melo
@ 2017-03-16 16:30 ` Ingo Molnar
  0 siblings, 0 replies; 40+ messages in thread
From: Ingo Molnar @ 2017-03-16 16:30 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexander Shishkin,
	Alexei Starovoitov, Ananth N Mavinakayanahalli, Andi Kleen,
	Andy Lutomirski, Anton Blanchard, Borislav Petkov, Brendan Gregg,
	David Ahern, David Miller, He Kuang, Hemant Kumar, Jiri Olsa,
	linuxppc-dev, Masami Hiramatsu, Mathieu Poirier,
	Michael Ellerman, Namhyung Kim, Naveen N . Rao, Peter Zijlstra,
	Ravi Bangoria, Srikar Dronamraju, Stephane Eranian,
	Steven Rostedt, Sukadev Bhattiprolu, Taeung Song,
	Thomas Gleixner, Wang Nan, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> Test results at the end of this message, as usual.
> 
> The following changes since commit ffa86c2f1a8862cf58c873f6f14d4b2c3250fb48:
> 
>   Merge tag 'perf-core-for-mingo-4.12-20170314' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-15 19:27:27 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.12-20170316
> 
> for you to fetch changes up to 61f35d750683b21e9e3836e309195c79c1daed74:
> 
>   uprobes: Default UPROBES_EVENTS to Y (2017-03-16 12:42:02 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> New features:
> 
> - Add 'brstackinsn' field in 'perf script' to reuse the x86 instruction
>   decoder used in the Intel PT code to study hot paths to samples (Andi Kleen)
> 
> Kernel:
> 
> - Default UPROBES_EVENTS to Y (Alexei Starovoitov)
> 
> - Fix check for kretprobe offset within function entry (Naveen N. Rao)
> 
> Infrastructure:
> 
> - Introduce util func is_sdt_event() (Ravi Bangoria)
> 
> - Make perf_event__synthesize_mmap_events() scale on older kernels where
>   reading /proc/pid/maps is way slower than reading /proc/pid/task/pid/maps (Stephane Eranian)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Andi Kleen (1):
>       perf script: Add 'brstackinsn' for branch stacks
> 
> Arnaldo Carvalho de Melo (2):
>       tools headers: Sync {tools/,}arch/x86/include/asm/cpufeatures.h
>       uprobes: Default UPROBES_EVENTS to Y
> 
> Naveen N. Rao (1):
>       trace/kprobes: Fix check for kretprobe offset within function entry
> 
> Ravi Bangoria (1):
>       perf probe: Introduce util func is_sdt_event()
> 
> Stephane Eranian (1):
>       perf tools: Make perf_event__synthesize_mmap_events() scale
> 
>  include/linux/kprobes.h                            |   1 +
>  kernel/kprobes.c                                   |  40 ++--
>  kernel/trace/Kconfig                               |   2 +-
>  kernel/trace/trace_kprobe.c                        |   2 +-
>  tools/arch/x86/include/asm/cpufeatures.h           |   5 +-
>  tools/perf/Documentation/perf-script.txt           |  13 +-
>  tools/perf/builtin-script.c                        | 264 ++++++++++++++++++++-
>  tools/perf/util/Build                              |   1 +
>  tools/perf/util/dump-insn.c                        |  14 ++
>  tools/perf/util/dump-insn.h                        |  22 ++
>  tools/perf/util/event.c                            |   4 +-
>  .../util/intel-pt-decoder/intel-pt-insn-decoder.c  |  24 ++
>  tools/perf/util/parse-events.h                     |  20 ++
>  tools/perf/util/probe-event.c                      |   9 +-
>  14 files changed, 381 insertions(+), 40 deletions(-)
>  create mode 100644 tools/perf/util/dump-insn.c
>  create mode 100644 tools/perf/util/dump-insn.h

Pulled, thanks a lot Arnaldo!

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [GIT PULL 0/6] perf/core improvements and fixes
@ 2017-03-16 16:09 Arnaldo Carvalho de Melo
  2017-03-16 16:30 ` Ingo Molnar
  0 siblings, 1 reply; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-16 16:09 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexander Shishkin, Alexei Starovoitov,
	Ananth N Mavinakayanahalli, Andi Kleen, Andy Lutomirski,
	Anton Blanchard, Borislav Petkov, Brendan Gregg, David Ahern,
	David Miller, He Kuang, Hemant Kumar, Jiri Olsa, linuxppc-dev,
	Masami Hiramatsu, Mathieu Poirier, Michael Ellerman,
	Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Ravi Bangoria,
	Srikar Dronamraju, Stephane Eranian, Steven Rostedt,
	Sukadev Bhattiprolu, Taeung Song, Thomas Gleixner, Wang Nan,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

Test results at the end of this message, as usual.

The following changes since commit ffa86c2f1a8862cf58c873f6f14d4b2c3250fb48:

  Merge tag 'perf-core-for-mingo-4.12-20170314' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-15 19:27:27 +0100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.12-20170316

for you to fetch changes up to 61f35d750683b21e9e3836e309195c79c1daed74:

  uprobes: Default UPROBES_EVENTS to Y (2017-03-16 12:42:02 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

New features:

- Add 'brstackinsn' field in 'perf script' to reuse the x86 instruction
  decoder used in the Intel PT code to study hot paths to samples (Andi Kleen)

Kernel:

- Default UPROBES_EVENTS to Y (Alexei Starovoitov)

- Fix check for kretprobe offset within function entry (Naveen N. Rao)

Infrastructure:

- Introduce util func is_sdt_event() (Ravi Bangoria)

- Make perf_event__synthesize_mmap_events() scale on older kernels where
  reading /proc/pid/maps is way slower than reading /proc/pid/task/pid/maps (Stephane Eranian)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Andi Kleen (1):
      perf script: Add 'brstackinsn' for branch stacks

Arnaldo Carvalho de Melo (2):
      tools headers: Sync {tools/,}arch/x86/include/asm/cpufeatures.h
      uprobes: Default UPROBES_EVENTS to Y

Naveen N. Rao (1):
      trace/kprobes: Fix check for kretprobe offset within function entry

Ravi Bangoria (1):
      perf probe: Introduce util func is_sdt_event()

Stephane Eranian (1):
      perf tools: Make perf_event__synthesize_mmap_events() scale

 include/linux/kprobes.h                            |   1 +
 kernel/kprobes.c                                   |  40 ++--
 kernel/trace/Kconfig                               |   2 +-
 kernel/trace/trace_kprobe.c                        |   2 +-
 tools/arch/x86/include/asm/cpufeatures.h           |   5 +-
 tools/perf/Documentation/perf-script.txt           |  13 +-
 tools/perf/builtin-script.c                        | 264 ++++++++++++++++++++-
 tools/perf/util/Build                              |   1 +
 tools/perf/util/dump-insn.c                        |  14 ++
 tools/perf/util/dump-insn.h                        |  22 ++
 tools/perf/util/event.c                            |   4 +-
 .../util/intel-pt-decoder/intel-pt-insn-decoder.c  |  24 ++
 tools/perf/util/parse-events.h                     |  20 ++
 tools/perf/util/probe-event.c                      |   9 +-
 14 files changed, 381 insertions(+), 40 deletions(-)
 create mode 100644 tools/perf/util/dump-insn.c
 create mode 100644 tools/perf/util/dump-insn.h

Test results:

The first ones are container (docker) based builds of tools/perf with and
without libelf support, objtool where it is supported and samples/bpf/, ditto.
Where clang is available, it is also used to build perf with/without libelf.

Several are cross builds, the ones with -x-ARCH, and the android one, and those
may not have all the features built, due to lack of multi-arch devel packages,
available and being used so far on just a few, like
debian:experimental-x-{arm64,mipsel}.

The 'perf test' one will perform a variety of tests exercising
tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands
with a variety of command line event specifications to then intercept the
sys_perf_event syscall to check that the perf_event_attr fields are set up as
expected, among a variety of other unit tests.

Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/
with a variety of feature sets, exercising the build with an incomplete set of
features as well as with a complete one. It is planned to have it run on each
of the containers mentioned above, using some container orchestration
infrastructure. Get in contact if interested in helping having this in place.

  # dm
   1 alpine:3.4: Ok
   2 alpine:3.5: Ok
   3 alpine:edge: Ok
   4 android-ndk:r12b-arm: Ok
   5 archlinux:latest: Ok
   6 centos:5: Ok
   7 centos:6: Ok
   8 centos:7: Ok
   9 debian:7: Ok
  10 debian:8: Ok
  11 debian:experimental: Ok
  12 debian:experimental-x-arm64: Ok
  13 debian:experimental-x-mips: Ok
  14 debian:experimental-x-mips64: Ok
  15 debian:experimental-x-mipsel: Ok
  16 fedora:20: Ok
  17 fedora:21: Ok
  18 fedora:22: Ok
  19 fedora:23: Ok
  20 fedora:24: Ok
  21 fedora:24-x-ARC-uClibc: Ok
  22 fedora:25: Ok
  23 fedora:rawhide: Ok
  24 mageia:5: Ok
  25 opensuse:13.2: Ok
  26 opensuse:42.1: Ok
  27 opensuse:tumbleweed: Ok
  28 ubuntu:12.04.5: Ok
  29 ubuntu:14.04.4: Ok
  30 ubuntu:14.04.4-x-linaro-arm64: Ok
  31 ubuntu:15.10: Ok
  32 ubuntu:16.04: Ok
  33 ubuntu:16.04-x-arm: Ok
  34 ubuntu:16.04-x-arm64: Ok
  35 ubuntu:16.04-x-powerpc: Ok
  36 ubuntu:16.04-x-powerpc64: Ok
  37 ubuntu:16.04-x-s390: Ok
  38 ubuntu:16.10: Ok
  39 ubuntu:17.04: Ok

  # uname -a
  Linux zoo 4.9.13-100.fc24.x86_64 #1 SMP Mon Feb 27 16:57:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  # perf test
   1: vmlinux symtab matches kallsyms            : Ok
   2: Detect openat syscall event                : Ok
   3: Detect openat syscall event on all cpus    : Ok
   4: Read samples using the mmap interface      : Ok
   5: Parse event definition strings             : Ok
   6: PERF_RECORD_* events & perf_sample fields  : Ok
   7: Parse perf pmu format                      : Ok
   8: DSO data read                              : Ok
   9: DSO data cache                             : Ok
  10: DSO data reopen                            : Ok
  11: Roundtrip evsel->name                      : Ok
  12: Parse sched tracepoints fields             : Ok
  13: syscalls:sys_enter_openat event fields     : Ok
  14: Setup struct perf_event_attr               : Ok
  15: Match and link multiple hists              : Ok
  16: 'import perf' in python                    : Ok
  17: Breakpoint overflow signal handler         : Ok
  18: Breakpoint overflow sampling               : Ok
  19: Number of exit events of a simple workload : Ok
  20: Software clock events period values        : Ok
  21: Object code reading                        : Ok
  22: Sample parsing                             : Ok
  23: Use a dummy software event to keep tracking: Ok
  24: Parse with no sample_id_all bit set        : Ok
  25: Filter hist entries                        : Ok
  26: Lookup mmap thread                         : Ok
  27: Share thread mg                            : Ok
  28: Sort output of hist entries                : Ok
  29: Cumulate child hist entries                : Ok
  30: Track with sched_switch                    : Ok
  31: Filter fds with revents mask in a fdarray  : Ok
  32: Add fd to a fdarray, making it autogrow    : Ok
  33: kmod_path__parse                           : Ok
  34: Thread map                                 : Ok
  35: LLVM search and compile                    :
  35.1: Basic BPF llvm compile                    : Ok
  35.2: kbuild searching                          : Ok
  35.3: Compile source for BPF prologue generation: Ok
  35.4: Compile source for BPF relocation         : Ok
  36: Session topology                           : Ok
  37: BPF filter                                 :
  37.1: Basic BPF filtering                      : Ok
  37.2: BPF pinning                              : Ok
  37.3: BPF prologue generation                  : Ok
  37.4: BPF relocation checker                   : Ok
  38: Synthesize thread map                      : Ok
  39: Remove thread map                          : Ok
  40: Synthesize cpu map                         : Ok
  41: Synthesize stat config                     : Ok
  42: Synthesize stat                            : Ok
  43: Synthesize stat round                      : Ok
  44: Synthesize attr update                     : Ok
  45: Event times                                : Ok
  46: Read backward ring buffer                  : Ok
  47: Print cpu map                              : Ok
  48: Probe SDT events                           : Ok
  49: is_printable_array                         : Ok
  50: Print bitmap                               : Ok
  51: perf hooks                                 : Ok
  52: builtin clang support                      : Skip (not compiled in)
  53: unit_number__scnprintf                     : Ok
  54: x86 rdpmc                                  : Ok
  55: Convert perf time to TSC                   : Ok
  56: DWARF unwind                               : Ok
  57: x86 instruction decoder - new instructions : Ok
  58: Intel cqm nmi context read                 : Skip
  # 
  $ make -C tools/perf build-test
  make: Entering directory '/home/acme/git/linux/tools/perf'
  - tarpkg: ./tests/perf-targz-src-pkg .
              make_no_libelf_O: make NO_LIBELF=1
             make_no_libperl_O: make NO_LIBPERL=1
             make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
             make_no_libnuma_O: make NO_LIBNUMA=1
                   make_pure_O: make
                 make_perf_o_O: make perf.o
                make_no_newt_O: make NO_NEWT=1
                   make_help_O: make help
            make_no_libaudit_O: make NO_LIBAUDIT=1
                 make_static_O: make LDFLAGS=-static
                    make_doc_O: make doc
              make_clean_all_O: make clean all
                  make_debug_O: make DEBUG=1
                make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1
           make_no_libunwind_O: make NO_LIBUNWIND=1
           make_no_libbionic_O: make NO_LIBBIONIC=1
           make_no_libpython_O: make NO_LIBPYTHON=1
               make_no_slang_O: make NO_SLANG=1
        make_with_babeltrace_O: make LIBBABELTRACE=1
         make_install_prefix_O: make install prefix=/tmp/krava
                  make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
       make_util_pmu_bison_o_O: make util/pmu-bison.o
            make_no_demangle_O: make NO_DEMANGLE=1
   make_install_prefix_slash_O: make install prefix=/tmp/krava/
  make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
            make_no_auxtrace_O: make NO_AUXTRACE=1
            make_install_bin_O: make install-bin
             make_util_map_o_O: make util/map.o
                   make_tags_O: make tags
              make_no_libbpf_O: make NO_LIBBPF=1
                make_install_O: make install
                make_no_gtk2_O: make NO_GTK2=1
           make_no_backtrace_O: make NO_BACKTRACE=1
         make_with_clangllvm_O: make LIBCLANGLLVM=1
  OK
  make: Leaving directory '/home/acme/git/linux/tools/perf'

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-08-31 21:36 Arnaldo Carvalho de Melo
@ 2015-09-01  8:26 ` Ingo Molnar
  0 siblings, 0 replies; 40+ messages in thread
From: Ingo Molnar @ 2015-09-01  8:26 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexei Starovoitov, Andi Kleen,
	Brendan Gregg, Daniel Borkmann, David Ahern, He Kuang, Jiri Olsa,
	Kaixu Xia, Kan Liang, Masami Hiramatsu, Namhyung Kim,
	Peter Zijlstra, pi3orama, Stephane Eranian, Sukadev Bhattiprolu,
	Wang Nan, Zefan Li, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit bac2e4a96d1c0bcce5e9654dcc902f75576b9b03:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-08-31 10:25:46 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
> 
> for you to fetch changes up to bcc84ec65ad1bd9f777a1fade6f8e5e0c5808fa5:
> 
>   perf record: Add ability to name registers to record (2015-08-31 18:01:33 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Add ability to specify to select which registers to record,
>   to reduce the size of perf.data files, and also allow printing
>   the registers in 'perf script': (Stephane Eranian)
> 
>     # perf record --intr-regs=AX,SP usleep 1
>     [ perf record: Woken up 1 times to write data ]
>     [ perf record: Captured and wrote 0.016 MB perf.data (8 samples) ]
>     # perf script -F ip,sym,iregs | tail -5
>      ffffffff8105f42a native_write_msr_safe   AX:0xf    SP:0xffff8802629c3c00
>      ffffffff8105f42a native_write_msr_safe   AX:0xf    SP:0xffff8802629c3c00
>      ffffffff81761ac0 _raw_spin_lock   AX:0xffff8801bfcf8020    SP:0xffff8802629c3ce8
>      ffffffff81202bf8 __vma_adjust_trans_huge   AX:0x7ffc75200000    SP:0xffff8802629c3b30
>      ffffffff8122b089 dput   AX:0x101    SP:0xffff8802629c3c78
>     #
> 
> Infrastructure:
> 
> - Open event on evsel cpus and threads (Kan Liang)
> 
> - New bpf API to get name from a BPF object (Wang Nan)
> 
> Build fixes:
> 
> - Fix build on powerpc broken by pt/bts (Adrian Hunter)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Adrian Hunter (1):
>       perf tools: Fix build on powerpc broken by pt/bts
> 
> Kan Liang (1):
>       perf evlist: Open event on evsel cpus and threads
> 
> Stephane Eranian (3):
>       perf script: Enable printing of interrupted machine state
>       perf/x86: Add list of register names
>       perf record: Add ability to name registers to record
> 
> Wang Nan (1):
>       bpf tools: New API to get name from a BPF object
> 
>  tools/lib/bpf/libbpf.c                             | 25 +++++++-
>  tools/lib/bpf/libbpf.h                             |  4 +-
>  tools/perf/Documentation/perf-record.txt           |  6 +-
>  tools/perf/Documentation/perf-script.txt           |  2 +-
>  tools/perf/arch/x86/util/Build                     |  1 +
>  tools/perf/arch/x86/util/perf_regs.c               | 30 +++++++++
>  tools/perf/builtin-record.c                        |  9 ++-
>  tools/perf/builtin-script.c                        | 31 +++++++++-
>  tools/perf/perf.h                                  |  2 +-
>  tools/perf/tests/llvm.c                            |  2 +-
>  tools/perf/util/Build                              |  2 +
>  tools/perf/util/evlist.c                           |  4 ++
>  tools/perf/util/evsel.c                            |  2 +-
>  .../util/intel-pt-decoder/intel-pt-insn-decoder.c  |  3 +
>  tools/perf/util/parse-regs-options.c               | 71 ++++++++++++++++++++++
>  tools/perf/util/parse-regs-options.h               |  5 ++
>  tools/perf/util/perf_regs.h                        |  7 +++
>  17 files changed, 193 insertions(+), 13 deletions(-)
>  create mode 100644 tools/perf/arch/x86/util/perf_regs.c
>  create mode 100644 tools/perf/util/parse-regs-options.c
>  create mode 100644 tools/perf/util/parse-regs-options.h

Pulled into tip:perf/urgent, thanks a lot Arnaldo!

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [GIT PULL 0/6] perf/core improvements and fixes
@ 2015-08-31 21:36 Arnaldo Carvalho de Melo
  2015-09-01  8:26 ` Ingo Molnar
  0 siblings, 1 reply; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-08-31 21:36 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexei Starovoitov, Andi Kleen, Brendan Gregg, Daniel Borkmann,
	David Ahern, He Kuang, Jiri Olsa, Kaixu Xia, Kan Liang,
	Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, pi3orama,
	Stephane Eranian, Sukadev Bhattiprolu, Wang Nan, Zefan Li,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit bac2e4a96d1c0bcce5e9654dcc902f75576b9b03:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-08-31 10:25:46 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo

for you to fetch changes up to bcc84ec65ad1bd9f777a1fade6f8e5e0c5808fa5:

  perf record: Add ability to name registers to record (2015-08-31 18:01:33 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

User visible:

- Add ability to specify to select which registers to record,
  to reduce the size of perf.data files, and also allow printing
  the registers in 'perf script': (Stephane Eranian)

    # perf record --intr-regs=AX,SP usleep 1
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.016 MB perf.data (8 samples) ]
    # perf script -F ip,sym,iregs | tail -5
     ffffffff8105f42a native_write_msr_safe   AX:0xf    SP:0xffff8802629c3c00
     ffffffff8105f42a native_write_msr_safe   AX:0xf    SP:0xffff8802629c3c00
     ffffffff81761ac0 _raw_spin_lock   AX:0xffff8801bfcf8020    SP:0xffff8802629c3ce8
     ffffffff81202bf8 __vma_adjust_trans_huge   AX:0x7ffc75200000    SP:0xffff8802629c3b30
     ffffffff8122b089 dput   AX:0x101    SP:0xffff8802629c3c78
    #

Infrastructure:

- Open event on evsel cpus and threads (Kan Liang)

- New bpf API to get name from a BPF object (Wang Nan)

Build fixes:

- Fix build on powerpc broken by pt/bts (Adrian Hunter)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Adrian Hunter (1):
      perf tools: Fix build on powerpc broken by pt/bts

Kan Liang (1):
      perf evlist: Open event on evsel cpus and threads

Stephane Eranian (3):
      perf script: Enable printing of interrupted machine state
      perf/x86: Add list of register names
      perf record: Add ability to name registers to record

Wang Nan (1):
      bpf tools: New API to get name from a BPF object

 tools/lib/bpf/libbpf.c                             | 25 +++++++-
 tools/lib/bpf/libbpf.h                             |  4 +-
 tools/perf/Documentation/perf-record.txt           |  6 +-
 tools/perf/Documentation/perf-script.txt           |  2 +-
 tools/perf/arch/x86/util/Build                     |  1 +
 tools/perf/arch/x86/util/perf_regs.c               | 30 +++++++++
 tools/perf/builtin-record.c                        |  9 ++-
 tools/perf/builtin-script.c                        | 31 +++++++++-
 tools/perf/perf.h                                  |  2 +-
 tools/perf/tests/llvm.c                            |  2 +-
 tools/perf/util/Build                              |  2 +
 tools/perf/util/evlist.c                           |  4 ++
 tools/perf/util/evsel.c                            |  2 +-
 .../util/intel-pt-decoder/intel-pt-insn-decoder.c  |  3 +
 tools/perf/util/parse-regs-options.c               | 71 ++++++++++++++++++++++
 tools/perf/util/parse-regs-options.h               |  5 ++
 tools/perf/util/perf_regs.h                        |  7 +++
 17 files changed, 193 insertions(+), 13 deletions(-)
 create mode 100644 tools/perf/arch/x86/util/perf_regs.c
 create mode 100644 tools/perf/util/parse-regs-options.c
 create mode 100644 tools/perf/util/parse-regs-options.h

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-06-05 14:06                       ` Arnaldo Carvalho de Melo
@ 2015-06-07 13:11                         ` Ingo Molnar
  0 siblings, 0 replies; 40+ messages in thread
From: Ingo Molnar @ 2015-06-07 13:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Wangnan (F),
	Alexei Starovoitov, pi3orama, linux-kernel, Adrian Hunter,
	Brendan Gregg, Daniel Borkmann, David Ahern, He Kuang, Jiri Olsa,
	Kaixu Xia, Madhavan Srinivasan, Masami Hiramatsu,
	Michael Ellerman, Namhyung Kim, Peter Zijlstra,
	Sukadev Bhattiprolu, Zefan Li, Alexei Starovoitov


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Em Fri, Jun 05, 2015 at 02:05:50PM +0200, Ingo Molnar escreveu:
> > * Wangnan (F) <wangnan0@huawei.com> wrote:
> <SNIP>
> > > One problem I can find is that, the wrapper will make perf depend on llvm. I 
> > > don't think the compiler will be deployed in production environments... And 
> > > also, the embedded case...
>  
> > What dependencies are there?
>  
> > On the usage side there should be very few outright dependencies: if the llvm 
> > binary is not available, or doesn't support what you need, or there's no runtime 
> > environment you can use to build the bytecode, you should display an informative 
> > error message so that the user knows what is missing and how to install it.
> 
> Right, something like:
> 
> [acme@zoo ~]$ perf trace -e nanosleep usleep 1
> Error:	No permissions to read /sys/kernel/debug/tracing/events/raw_syscalls/sys_(enter|exit)
> Hint:	Try 'sudo mount -o remount,mode=755 /sys/kernel/debug'

> [acme@zoo ~]$ sudo mount -o remount,mode=755 /sys/kernel/debug
> [sudo] password for acme: 
> [acme@zoo ~]$ perf trace -e nanosleep usleep 1
>      0.565 ( 0.060 ms): usleep/17648 nanosleep(rqtp: 0x7fff22baebf0) = 0
> [acme@zoo ~]$ perf trace --all-cpus
> Error:	Operation not permitted.
> Hint:	Check /proc/sys/kernel/perf_event_paranoid setting.
> Hint:	For system wide tracing it needs to be set to -1.
> Hint:	Try: 'sudo sh -c "echo -1 > /proc/sys/kernel/perf_event_paranoid"'
> Hint:	The current value is 1.
> [acme@zoo ~]$ 
> [acme@zoo ~]$ trace -a -e poll usleep 1
> [acme@zoo ~]$ trace -a -e poll usleep 1
>  0.041 ( 0.000 ms): firefox/1458  ... [continued]: poll()) = 1
>  0.267 ( 0.003 ms): firefox/1458 poll(ufds: 0x7f43d6ea1340, nfds: 5) = 0 Timeout
>  0.275 ( 0.001 ms): firefox/1458 poll(ufds: 0x7f43d6ea1340, nfds: 5) = 0 Timeout
>  0.283 ( 0.001 ms): firefox/1458 poll(ufds: 0x7f43d6ea1340, nfds: 5) = 0 Timeout
>  0.979 ( 0.000 ms): gnome-terminal/2572  ... [continued]: poll()) = 1
>  1.056 ( 0.768 ms): firefox/1458 poll(ufds: 0x7f43d6ea1340, nfds: 5, timeout_msecs: 4294967295) ...
>  1.065 ( 0.009 ms): gnome-terminal/2572 poll(ufds: 0x1934250, nfds: 23, timeout_msecs: 10) = 1
>  1.087 ( 0.007 ms): gnome-terminal/2572 poll(ufds: 0x1934250, nfds: 23, timeout_msecs: 10) = 2
>  1.132 ( 0.007 ms): gnome-terminal/2572 poll(ufds: 0x1934250, nfds: 23, timeout_msecs: 10) = 1
>  1.161 ( 0.013 ms): gnome-terminal/2572 poll(ufds: 0x1934250, nfds: 23, timeout_msecs: 10) = 1
> [acme@zoo ~]$
> 
> I.e. Explain the mistake and provide a hint to solve it, as close to the actual
> commands needed to perform such corrective/enabling action as possible.

Yeah, I absolutely love such tooling hints.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-06-05 12:05                     ` Ingo Molnar
@ 2015-06-05 14:06                       ` Arnaldo Carvalho de Melo
  2015-06-07 13:11                         ` Ingo Molnar
  0 siblings, 1 reply; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-06-05 14:06 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Wangnan (F),
	Alexei Starovoitov, pi3orama, linux-kernel, Adrian Hunter,
	Brendan Gregg, Daniel Borkmann, David Ahern, He Kuang, Jiri Olsa,
	Kaixu Xia, Madhavan Srinivasan, Masami Hiramatsu,
	Michael Ellerman, Namhyung Kim, Peter Zijlstra,
	Sukadev Bhattiprolu, Zefan Li, Alexei Starovoitov

Em Fri, Jun 05, 2015 at 02:05:50PM +0200, Ingo Molnar escreveu:
> * Wangnan (F) <wangnan0@huawei.com> wrote:
<SNIP>
> > One problem I can find is that, the wrapper will make perf depend on llvm. I 
> > don't think the compiler will be deployed in production environments... And 
> > also, the embedded case...
 
> What dependencies are there?
 
> On the usage side there should be very few outright dependencies: if the llvm 
> binary is not available, or doesn't support what you need, or there's no runtime 
> environment you can use to build the bytecode, you should display an informative 
> error message so that the user knows what is missing and how to install it.

Right, something like:

[acme@zoo ~]$ perf trace -e nanosleep usleep 1
Error:	No permissions to read /sys/kernel/debug/tracing/events/raw_syscalls/sys_(enter|exit)
Hint:	Try 'sudo mount -o remount,mode=755 /sys/kernel/debug'
[acme@zoo ~]$ sudo mount -o remount,mode=755 /sys/kernel/debug
[sudo] password for acme: 
[acme@zoo ~]$ perf trace -e nanosleep usleep 1
     0.565 ( 0.060 ms): usleep/17648 nanosleep(rqtp: 0x7fff22baebf0) = 0
[acme@zoo ~]$ perf trace --all-cpus
Error:	Operation not permitted.
Hint:	Check /proc/sys/kernel/perf_event_paranoid setting.
Hint:	For system wide tracing it needs to be set to -1.
Hint:	Try: 'sudo sh -c "echo -1 > /proc/sys/kernel/perf_event_paranoid"'
Hint:	The current value is 1.
[acme@zoo ~]$ 
[acme@zoo ~]$ trace -a -e poll usleep 1
[acme@zoo ~]$ trace -a -e poll usleep 1
 0.041 ( 0.000 ms): firefox/1458  ... [continued]: poll()) = 1
 0.267 ( 0.003 ms): firefox/1458 poll(ufds: 0x7f43d6ea1340, nfds: 5) = 0 Timeout
 0.275 ( 0.001 ms): firefox/1458 poll(ufds: 0x7f43d6ea1340, nfds: 5) = 0 Timeout
 0.283 ( 0.001 ms): firefox/1458 poll(ufds: 0x7f43d6ea1340, nfds: 5) = 0 Timeout
 0.979 ( 0.000 ms): gnome-terminal/2572  ... [continued]: poll()) = 1
 1.056 ( 0.768 ms): firefox/1458 poll(ufds: 0x7f43d6ea1340, nfds: 5, timeout_msecs: 4294967295) ...
 1.065 ( 0.009 ms): gnome-terminal/2572 poll(ufds: 0x1934250, nfds: 23, timeout_msecs: 10) = 1
 1.087 ( 0.007 ms): gnome-terminal/2572 poll(ufds: 0x1934250, nfds: 23, timeout_msecs: 10) = 2
 1.132 ( 0.007 ms): gnome-terminal/2572 poll(ufds: 0x1934250, nfds: 23, timeout_msecs: 10) = 1
 1.161 ( 0.013 ms): gnome-terminal/2572 poll(ufds: 0x1934250, nfds: 23, timeout_msecs: 10) = 1
[acme@zoo ~]$

I.e. Explain the mistake and provide a hint to solve it, as close to the actual
commands needed to perform such corrective/enabling action as possible.

- Arnaldo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-06-05  8:53                   ` Wangnan (F)
  2015-06-05 12:05                     ` Ingo Molnar
@ 2015-06-05 13:59                     ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-06-05 13:59 UTC (permalink / raw)
  To: Wangnan (F)
  Cc: Ingo Molnar, Alexei Starovoitov, pi3orama, linux-kernel,
	Adrian Hunter, Brendan Gregg, Daniel Borkmann, David Ahern,
	He Kuang, Jiri Olsa, Kaixu Xia, Madhavan Srinivasan,
	Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Peter Zijlstra,
	Sukadev Bhattiprolu, Zefan Li, Alexei Starovoitov

Em Fri, Jun 05, 2015 at 04:53:03PM +0800, Wangnan (F) escreveu:
> On 2015/6/5 14:41, Ingo Molnar wrote:
> >* Alexei Starovoitov <ast@plumgrid.com> wrote:
> >>On 6/4/15 7:04 AM, Ingo Molnar wrote:
> >In fact I'm NAK-ing the whole .o based interface until the .c interface is made
> >the _primary_ one and works well and until I see that you have thought through
> >basic usability questions...
 
> OK. Let's start making a nice UI.
 
> At this stage, what about wrapping current clang and llc workflow into perf,
> let it call them to compile '.c' scripts? This is the way 'perf annotate'
> using
> objdump. I can do this job, but firstly I'd like to know people's opinion on

Right, no need for, at a first step, to save this into a cache, or use
libraries, etc, just automate the bpf.c into bpf.o, load it and use it
as an event.

> it, and the value of the wrapper if Alexei Starovoitov's dynamic compiler
> shared object is coming.

No need to wait for that, when it comes we can use it, but Ingo
established as the door for this to be accepted is that we could use:

  perf record -e foo.c usleep

Right?
 
> Following functions will be added:
> 
>  - perf searches clang and llc under current $PATH,

Good for a first step
 
>  - Users are allowed to pass the position of those programs,
>    if perf failed to find the automatically,

I would leave all this configurabilty for later, stating that it has to
be in the PATH should be ok for a first step.
 
>  - Users are allowed to pass extra compiling options to clang and llc, like
>    include directories,

For later too?
 
>  - 'perf record' automatically calls them if a '.c' is passed using
> '--event'.

Right.
 
>  - 'perf bpf compile' command will be added to compile a '.c' find into
> '.o',

for later? I.e. 'perf record -e foo.c usleep' could start by generating
the foo.o and not deleting it, so:

   perf record -e foo.c usleep

Followed by:

   perf record -e foo.o usleep

Would work, the later would be like a quick hack so that we could have
access to a pre-compiled foo.o quickly, at this introductory stage.

> Further, basic header files should be shipped with kernel headers.
> 
> User interface update:
> 
>  - --llc, --clang, --llc-opt and --clang-opt option will be added to 'perf
> record'
>    to indicate the position and extra options to them. Ideally they can be
> leave
>    blank.

Couldn't this be left to a section in a .perfconfig file to avoid having
so many command line options? We could have one of those files per
"project", after we add a --config option to 'perf record', to override
whatever it finds in the config file search it already does, i.e.:

[clang]

  path = /a/b/clang
  opt = -a -b -c -d

[llc]

  path = /d/e/llc
  opt = -r -t -y -u

But even this can be left for a second step.
 
>  - 'perf bpf compile' will be added.

> One problem I can find is that, the wrapper will make perf depend on
> llvm. I don't think the compiler will be deployed in production
> environments... And also, the embedded case...

Well, we can always build a subset of perf, using the command line
options to disable certain features.
 
- Arnaldo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-06-05  8:53                   ` Wangnan (F)
@ 2015-06-05 12:05                     ` Ingo Molnar
  2015-06-05 14:06                       ` Arnaldo Carvalho de Melo
  2015-06-05 13:59                     ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 40+ messages in thread
From: Ingo Molnar @ 2015-06-05 12:05 UTC (permalink / raw)
  To: Wangnan (F)
  Cc: Alexei Starovoitov, pi3orama, Arnaldo Carvalho de Melo,
	linux-kernel, Adrian Hunter, Brendan Gregg, Daniel Borkmann,
	David Ahern, He Kuang, Jiri Olsa, Kaixu Xia, Madhavan Srinivasan,
	Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Peter Zijlstra,
	Sukadev Bhattiprolu, Zefan Li, Arnaldo Carvalho de Melo,
	Alexei Starovoitov


* Wangnan (F) <wangnan0@huawei.com> wrote:

> OK. Let's start making a nice UI.

Thanks!

> [...]
>
> One problem I can find is that, the wrapper will make perf depend on llvm. I 
> don't think the compiler will be deployed in production environments... And 
> also, the embedded case...

What dependencies are there?

On the usage side there should be very few outright dependencies: if the llvm 
binary is not available, or doesn't support what you need, or there's no runtime 
environment you can use to build the bytecode, you should display an informative 
error message so that the user knows what is missing and how to install it.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-06-05  6:41                 ` Ingo Molnar
@ 2015-06-05  8:53                   ` Wangnan (F)
  2015-06-05 12:05                     ` Ingo Molnar
  2015-06-05 13:59                     ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 40+ messages in thread
From: Wangnan (F) @ 2015-06-05  8:53 UTC (permalink / raw)
  To: Ingo Molnar, Alexei Starovoitov
  Cc: pi3orama, Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Brendan Gregg, Daniel Borkmann, David Ahern, He Kuang, Jiri Olsa,
	Kaixu Xia, Madhavan Srinivasan, Masami Hiramatsu,
	Michael Ellerman, Namhyung Kim, Peter Zijlstra,
	Sukadev Bhattiprolu, Zefan Li, Arnaldo Carvalho de Melo,
	Alexei Starovoitov



On 2015/6/5 14:41, Ingo Molnar wrote:
> * Alexei Starovoitov <ast@plumgrid.com> wrote:
>
>> On 6/4/15 7:04 AM, Ingo Molnar wrote:
>>>>>   # perf record -e bpf_source.c cmdline
>>>>>
>>>>>   to create a eBPF filter from source,
>>>>>
>>>>> Use
>>>>>
>>>>> # perf record -e bpf_object.o cmdline
>>>>>
>>>>> to create a eBPF filter from object intermedia.
>>>>>
>>>>> Use
>>>>>
>>>>> # perf bpf compile bpf_source.c --kbuild=kernel-build-dir -o bpf_object.o
>>>>>
>>>>> to create the .o
>>>>>
>>>>> I think this should be enough. Currently only the second case has been implemented.
>>> So if users cannot actually generate .o files then it's premature to merge
>>> this in such an incomplete form!
>>>
>>> It should be possible to use a feature that we are merging.
>> of course it's usable :) There is some confusion here.
>> To compile .c into .o one can easily use
>> clang -O2 -emit-llvm -c file.c -o - | llc -march=bpf -o file.o
> There's no confusion here: you guys are trying to sell me what at this stage is
> incomplete and hard to use, and I'm resisting it as I should! :-)
>
> We also have different definitions of 'easily'. It might be 'easy' to type:
>   
>      clang -O2 -emit-llvm -c file.c -o - | llc -march=bpf -o file.o
>
> ... for some tooling developer intimate with eBPF, but to the first time user who
> found an interesting looking eBPF scriptlet on the net or in the documentation and
> wants to try his luck? It's absolutely non-obvious!
>
> The current usage to get a _minimal_ eBPF script running is non-obvious and
> obscure to the level of being a show stopper.
>
> I don't understand why you guys are even wasting time arguing about it: it's not
> that hard to auto-build from source code. It's one of the basic features of
> tooling. If you ever built perf you'll know that typing 'make install' will type
> in all those quirky build lines automatically for you, without requiring you to
> perform any other step, no matter how trivial.
>
> Doubly annoying, you seem to have the UI principles wrong, you seem to think that
> a .o is a proper user interface. It absolutely is _not_ okay.
>
> The Linux kernel project and as an extension the perf project deals with source
> code, and I'm 100% suspicious of approaches that somehow think that .o objects are
> the right UI for _anything_ except temporary files that sometimes show up in
> object directories...
>
> Fix the 'newbie user' UI flow as a _first_ priority, not as a second thought!
>
> Every single quirky line or nonsensical option you require a first time user to
> type halves the number of new users we'll get. You need to understand why dtrace
> is so popular:
>
>     - it's bloody easy to use
>
>     - it's a safe environment you can deploy in critical environments
>
>     - it's flexible
>
>     - instrumentation hacks are very easy to share
>
> eBPF based scripting got 3 out of those 4 right, but please don't forget item 1
> either, because without that we have nothing but a bunch of unusable functionality
> in the kernel and in tooling that benefits only very few people. Okay?
>
>> So I think we need to support both 'perf record -e file.[co]'
> Why do you even need to ask? Of course!
>
> Think through how users will meet eBPF scripts and how they will interact with
> them:
>
>    - they'll see or download an eBPF scriptlet somewhere and will have a .c file.
>
>    - ideally there will be built-in eBPF scriptlets just like we have tracing
>      plugins, and there's a good UI to query them and see their description and
>      source code.
>
>    - then they will want to use it all with the minimum amount of fuss
>
>    - they don't care how the eBPF scriptlet gets to the kernel: whether the kernel
>      can read and build the .c files, or whether there's some user tooling that
>      turns it into bytecode. Most humans don't read bytecode!
>
>    - they will absolutely not download random .o's and we should not encourage that
>      in any case - these things should be source code based.
>
> These things compile in an eye blink, there's very little reason to ever deal with
> a .o, except some weird and rare usecases...
>
> In fact I'm NAK-ing the whole .o based interface until the .c interface is made
> the _primary_ one and works well and until I see that you have thought through
> basic usability questions...

OK. Let's start making a nice UI.

At this stage, what about wrapping current clang and llc workflow into perf,
let it call them to compile '.c' scripts? This is the way 'perf 
annotate' using
objdump. I can do this job, but firstly I'd like to know people's opinion on
it, and the value of the wrapper if Alexei Starovoitov's dynamic compiler
shared object is coming.

Following functions will be added:

  - perf searches clang and llc under current $PATH,

  - Users are allowed to pass the position of those programs,
    if perf failed to find the automatically,

  - Users are allowed to pass extra compiling options to clang and llc, like
    include directories,

  - 'perf record' automatically calls them if a '.c' is passed using 
'--event'.

  - 'perf bpf compile' command will be added to compile a '.c' find into 
'.o',

Further, basic header files should be shipped with kernel headers.

User interface update:

  - --llc, --clang, --llc-opt and --clang-opt option will be added to 
'perf record'
    to indicate the position and extra options to them. Ideally they can 
be leave
    blank.

  - 'perf bpf compile' will be added.

One problem I can find is that, the wrapper will make perf depend on 
llvm. I don't
think the compiler will be deployed in production environments... And 
also, the
embedded case...

Any suggestion? Do you think the above idea is on the right way?

Thanks.

> Thanks,
>
> 	Ingo



^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-06-04 16:22               ` Alexei Starovoitov
  2015-06-04 21:48                 ` Masami Hiramatsu
@ 2015-06-05  6:41                 ` Ingo Molnar
  2015-06-05  8:53                   ` Wangnan (F)
  1 sibling, 1 reply; 40+ messages in thread
From: Ingo Molnar @ 2015-06-05  6:41 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: pi3orama, Wangnan (F),
	Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Brendan Gregg, Daniel Borkmann, David Ahern, He Kuang, Jiri Olsa,
	Kaixu Xia, Madhavan Srinivasan, Masami Hiramatsu,
	Michael Ellerman, Namhyung Kim, Peter Zijlstra,
	Sukadev Bhattiprolu, Zefan Li, Arnaldo Carvalho de Melo,
	Alexei Starovoitov


* Alexei Starovoitov <ast@plumgrid.com> wrote:

> On 6/4/15 7:04 AM, Ingo Molnar wrote:
> >>>  # perf record -e bpf_source.c cmdline
> >>>
> >>>  to create a eBPF filter from source,
> >>>
> >>>Use
> >>>
> >>># perf record -e bpf_object.o cmdline
> >>>
> >>>to create a eBPF filter from object intermedia.
> >>>
> >>>Use
> >>>
> >>># perf bpf compile bpf_source.c --kbuild=kernel-build-dir -o bpf_object.o
> >>>
> >>>to create the .o
> >>>
> >>>I think this should be enough. Currently only the second case has been implemented.
> >
> > So if users cannot actually generate .o files then it's premature to merge 
> > this in such an incomplete form!
> >
> > It should be possible to use a feature that we are merging.
> 
> of course it's usable :) There is some confusion here.
> To compile .c into .o one can easily use
> clang -O2 -emit-llvm -c file.c -o - | llc -march=bpf -o file.o

There's no confusion here: you guys are trying to sell me what at this stage is 
incomplete and hard to use, and I'm resisting it as I should! :-)

We also have different definitions of 'easily'. It might be 'easy' to type:
 
    clang -O2 -emit-llvm -c file.c -o - | llc -march=bpf -o file.o

... for some tooling developer intimate with eBPF, but to the first time user who 
found an interesting looking eBPF scriptlet on the net or in the documentation and 
wants to try his luck? It's absolutely non-obvious!

The current usage to get a _minimal_ eBPF script running is non-obvious and 
obscure to the level of being a show stopper.

I don't understand why you guys are even wasting time arguing about it: it's not 
that hard to auto-build from source code. It's one of the basic features of 
tooling. If you ever built perf you'll know that typing 'make install' will type 
in all those quirky build lines automatically for you, without requiring you to 
perform any other step, no matter how trivial.

Doubly annoying, you seem to have the UI principles wrong, you seem to think that 
a .o is a proper user interface. It absolutely is _not_ okay.

The Linux kernel project and as an extension the perf project deals with source 
code, and I'm 100% suspicious of approaches that somehow think that .o objects are 
the right UI for _anything_ except temporary files that sometimes show up in 
object directories...

Fix the 'newbie user' UI flow as a _first_ priority, not as a second thought!

Every single quirky line or nonsensical option you require a first time user to 
type halves the number of new users we'll get. You need to understand why dtrace 
is so popular:

   - it's bloody easy to use

   - it's a safe environment you can deploy in critical environments

   - it's flexible

   - instrumentation hacks are very easy to share

eBPF based scripting got 3 out of those 4 right, but please don't forget item 1 
either, because without that we have nothing but a bunch of unusable functionality 
in the kernel and in tooling that benefits only very few people. Okay?

> So I think we need to support both 'perf record -e file.[co]'

Why do you even need to ask? Of course!

Think through how users will meet eBPF scripts and how they will interact with 
them:

  - they'll see or download an eBPF scriptlet somewhere and will have a .c file.

  - ideally there will be built-in eBPF scriptlets just like we have tracing 
    plugins, and there's a good UI to query them and see their description and 
    source code.

  - then they will want to use it all with the minimum amount of fuss

  - they don't care how the eBPF scriptlet gets to the kernel: whether the kernel 
    can read and build the .c files, or whether there's some user tooling that
    turns it into bytecode. Most humans don't read bytecode!

  - they will absolutely not download random .o's and we should not encourage that
    in any case - these things should be source code based.

These things compile in an eye blink, there's very little reason to ever deal with 
a .o, except some weird and rare usecases...

In fact I'm NAK-ing the whole .o based interface until the .c interface is made 
the _primary_ one and works well and until I see that you have thought through 
basic usability questions...

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-06-04 21:48                 ` Masami Hiramatsu
@ 2015-06-04 22:07                   ` Alexei Starovoitov
  0 siblings, 0 replies; 40+ messages in thread
From: Alexei Starovoitov @ 2015-06-04 22:07 UTC (permalink / raw)
  To: Masami Hiramatsu, Ingo Molnar, pi3orama
  Cc: Wangnan (F),
	Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Brendan Gregg, Daniel Borkmann, David Ahern, He Kuang, Jiri Olsa,
	Kaixu Xia, Madhavan Srinivasan, Michael Ellerman, Namhyung Kim,
	Peter Zijlstra, Sukadev Bhattiprolu, Zefan Li,
	Arnaldo Carvalho de Melo, Alexei Starovoitov,
	cti.systems-productivity-manager.ts

On 6/4/15 2:48 PM, Masami Hiramatsu wrote:
> On 2015/06/05 1:22, Alexei Starovoitov wrote:
>> On 6/4/15 7:04 AM, Ingo Molnar wrote:
>>>>>   # perf record -e bpf_source.c cmdline
>>>>>
>>>>>   to create a eBPF filter from source,
>>>>>
>>>>> Use
>>>>>
>>>>> # perf record -e bpf_object.o cmdline
>>>>>
>>>>> to create a eBPF filter from object intermedia.
>>>>>
>>>>> Use
>>>>>
>>>>> # perf bpf compile bpf_source.c --kbuild=kernel-build-dir -o bpf_object.o
>>>>>
>>>>> to create the .o
>>>>>
>>>>> I think this should be enough. Currently only the second case has been implemented.
>>> So if users cannot actually generate .o files then it's premature to merge this in
>>> such an incomplete form!
>>>
>>> It should be possible to use a feature that we are merging.
>>
>> of course it's usable :) There is some confusion here.
>> To compile .c into .o one can easily use
>> clang -O2 -emit-llvm -c file.c -o - | llc -march=bpf -o file.o
>> any version of clang is ok,
>> llc needs to be fresh with bpf backend.
>>
>> For a lot of cases kernel headers are not needed, so above
>> will work fine.
>> For our TC examples we recommend to use 'bcc' alias:
>> bcc() {
>>     clang -O2 -emit-llvm -c $1 -o - | llc -march=bpf -filetype=obj -o
>> "`basename $1 .c`.o"
>> }
>> then compiling as easy as 'bcc file.c'
>>
>> What Wang mentioned that we're working on is fully integrated 'bcc'.
>> It will use clang/llvm as libraries, so no intermediate steps will
>> be needed, but some folks will always have concerns about
>> ultra-embedded environments where even 20Mb of libllvm.so is too much.
>>
>> So I think we need to support both 'perf record -e file.[co]'
>
> I think we'd better make 'perf record -e file.c' default and '-e file.o'
> should be an option.

what do you mean 'default' ? It's a command line :)
.c is easier to use of course, no question.


^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-06-04 16:22               ` Alexei Starovoitov
@ 2015-06-04 21:48                 ` Masami Hiramatsu
  2015-06-04 22:07                   ` Alexei Starovoitov
  2015-06-05  6:41                 ` Ingo Molnar
  1 sibling, 1 reply; 40+ messages in thread
From: Masami Hiramatsu @ 2015-06-04 21:48 UTC (permalink / raw)
  To: Alexei Starovoitov, Ingo Molnar, pi3orama
  Cc: Wangnan (F),
	Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Brendan Gregg, Daniel Borkmann, David Ahern, He Kuang, Jiri Olsa,
	Kaixu Xia, Madhavan Srinivasan, Michael Ellerman, Namhyung Kim,
	Peter Zijlstra, Sukadev Bhattiprolu, Zefan Li,
	Arnaldo Carvalho de Melo, Alexei Starovoitov,
	cti.systems-productivity-manager.ts

On 2015/06/05 1:22, Alexei Starovoitov wrote:
> On 6/4/15 7:04 AM, Ingo Molnar wrote:
>>>>  # perf record -e bpf_source.c cmdline
>>>>
>>>>  to create a eBPF filter from source,
>>>>
>>>> Use
>>>>
>>>> # perf record -e bpf_object.o cmdline
>>>>
>>>> to create a eBPF filter from object intermedia.
>>>>
>>>> Use
>>>>
>>>> # perf bpf compile bpf_source.c --kbuild=kernel-build-dir -o bpf_object.o
>>>>
>>>> to create the .o
>>>>
>>>> I think this should be enough. Currently only the second case has been implemented.
>> So if users cannot actually generate .o files then it's premature to merge this in
>> such an incomplete form!
>>
>> It should be possible to use a feature that we are merging.
> 
> of course it's usable :) There is some confusion here.
> To compile .c into .o one can easily use
> clang -O2 -emit-llvm -c file.c -o - | llc -march=bpf -o file.o
> any version of clang is ok,
> llc needs to be fresh with bpf backend.
> 
> For a lot of cases kernel headers are not needed, so above
> will work fine.
> For our TC examples we recommend to use 'bcc' alias:
> bcc() {
>    clang -O2 -emit-llvm -c $1 -o - | llc -march=bpf -filetype=obj -o 
> "`basename $1 .c`.o"
> }
> then compiling as easy as 'bcc file.c'
> 
> What Wang mentioned that we're working on is fully integrated 'bcc'.
> It will use clang/llvm as libraries, so no intermediate steps will
> be needed, but some folks will always have concerns about
> ultra-embedded environments where even 20Mb of libllvm.so is too much.
> 
> So I think we need to support both 'perf record -e file.[co]'

I think we'd better make 'perf record -e file.c' default and '-e file.o'
should be an option.

Thank you,

> 
> 


-- 
Masami HIRAMATSU
Linux Technology Research Center, System Productivity Research Dept.
Center for Technology Innovation - Systems Engineering
Hitachi, Ltd., Research & Development Group
E-mail: masami.hiramatsu.pt@hitachi.com

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-06-04 14:04             ` Ingo Molnar
@ 2015-06-04 16:22               ` Alexei Starovoitov
  2015-06-04 21:48                 ` Masami Hiramatsu
  2015-06-05  6:41                 ` Ingo Molnar
  0 siblings, 2 replies; 40+ messages in thread
From: Alexei Starovoitov @ 2015-06-04 16:22 UTC (permalink / raw)
  To: Ingo Molnar, pi3orama
  Cc: Wangnan (F),
	Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Brendan Gregg, Daniel Borkmann, David Ahern, He Kuang, Jiri Olsa,
	Kaixu Xia, Madhavan Srinivasan, Masami Hiramatsu,
	Michael Ellerman, Namhyung Kim, Peter Zijlstra,
	Sukadev Bhattiprolu, Zefan Li, Arnaldo Carvalho de Melo,
	Alexei Starovoitov

On 6/4/15 7:04 AM, Ingo Molnar wrote:
>> >  # perf record -e bpf_source.c cmdline
>> >
>> >  to create a eBPF filter from source,
>> >
>> >Use
>> >
>> ># perf record -e bpf_object.o cmdline
>> >
>> >to create a eBPF filter from object intermedia.
>> >
>> >Use
>> >
>> ># perf bpf compile bpf_source.c --kbuild=kernel-build-dir -o bpf_object.o
>> >
>> >to create the .o
>> >
>> >I think this should be enough. Currently only the second case has been implemented.
> So if users cannot actually generate .o files then it's premature to merge this in
> such an incomplete form!
>
> It should be possible to use a feature that we are merging.

of course it's usable :) There is some confusion here.
To compile .c into .o one can easily use
clang -O2 -emit-llvm -c file.c -o - | llc -march=bpf -o file.o
any version of clang is ok,
llc needs to be fresh with bpf backend.

For a lot of cases kernel headers are not needed, so above
will work fine.
For our TC examples we recommend to use 'bcc' alias:
bcc() {
   clang -O2 -emit-llvm -c $1 -o - | llc -march=bpf -filetype=obj -o 
"`basename $1 .c`.o"
}
then compiling as easy as 'bcc file.c'

What Wang mentioned that we're working on is fully integrated 'bcc'.
It will use clang/llvm as libraries, so no intermediate steps will
be needed, but some folks will always have concerns about
ultra-embedded environments where even 20Mb of libllvm.so is too much.

So I think we need to support both 'perf record -e file.[co]'


^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-06-04 12:58           ` pi3orama
@ 2015-06-04 14:04             ` Ingo Molnar
  2015-06-04 16:22               ` Alexei Starovoitov
  0 siblings, 1 reply; 40+ messages in thread
From: Ingo Molnar @ 2015-06-04 14:04 UTC (permalink / raw)
  To: pi3orama
  Cc: Wangnan (F),
	Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Alexei Starovoitov, Brendan Gregg, Daniel Borkmann, David Ahern,
	He Kuang, Jiri Olsa, Kaixu Xia, Madhavan Srinivasan,
	Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Peter Zijlstra,
	Sukadev Bhattiprolu, Zefan Li, Arnaldo Carvalho de Melo,
	Alexei Starovoitov


* pi3orama <pi3orama@163.com> wrote:

> 
> 
> 发自我的 iPhone
> 
> > 在 2015年6月4日,下午8:40,Ingo Molnar <mingo@kernel.org> 写道:
> > 
> > 
> > * Wangnan (F) <wangnan0@huawei.com> wrote:
> > 
> >>> So how do you generate the .o? Why cannot the tool, if it sees that the filter 
> >>> parameter is eBPF source code, do that automatically?
> >> 
> >> I think compiling on the fly is our goal, and Alexei is working on it.
> > 
> > So what exact command line are you using to create the .o?
> > 
> > What exactly should users type to create a simple eBPF filter profile?
> 
> I have mentioned in previous mail:
> 
> Use
> 
>  # perf record -e bpf_source.c cmdline 
> 
>  to create a eBPF filter from source,
> 
> Use
> 
> # perf record -e bpf_object.o cmdline 
> 
> to create a eBPF filter from object intermedia.
> 
> Use
> 
> # perf bpf compile bpf_source.c --kbuild=kernel-build-dir -o bpf_object.o
> 
> to create the .o
> 
> I think this should be enough. Currently only the second case has been implemented.

So if users cannot actually generate .o files then it's premature to merge this in 
such an incomplete form!

It should be possible to use a feature that we are merging.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-06-04 12:40         ` Ingo Molnar
@ 2015-06-04 12:58           ` pi3orama
  2015-06-04 14:04             ` Ingo Molnar
  0 siblings, 1 reply; 40+ messages in thread
From: pi3orama @ 2015-06-04 12:58 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Wangnan (F),
	Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Alexei Starovoitov, Brendan Gregg, Daniel Borkmann, David Ahern,
	He Kuang, Jiri Olsa, Kaixu Xia, Madhavan Srinivasan,
	Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Peter Zijlstra,
	Sukadev Bhattiprolu, Zefan Li, Arnaldo Carvalho de Melo,
	Alexei Starovoitov



发自我的 iPhone

> 在 2015年6月4日,下午8:40,Ingo Molnar <mingo@kernel.org> 写道:
> 
> 
> * Wangnan (F) <wangnan0@huawei.com> wrote:
> 
>>> So how do you generate the .o? Why cannot the tool, if it sees that the filter 
>>> parameter is eBPF source code, do that automatically?
>> 
>> I think compiling on the fly is our goal, and Alexei is working on it.
> 
> So what exact command line are you using to create the .o?
> 
> What exactly should users type to create a simple eBPF filter profile?
> 

I have mentioned in previous mail:

Use

 # perf record -e bpf_source.c cmdline 

 to create a eBPF filter from source,

Use

# perf record -e bpf_object.o cmdline 

to create a eBPF filter from object intermedia.

Use

# perf bpf compile bpf_source.c --kbuild=kernel-build-dir -o bpf_object.o

to create the .o

I think this should be enough. Currently only the second case has been implemented.

Thanks.

> Thanks,
> 
>    Ingo


^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-06-04 10:00       ` Wangnan (F)
@ 2015-06-04 12:40         ` Ingo Molnar
  2015-06-04 12:58           ` pi3orama
  0 siblings, 1 reply; 40+ messages in thread
From: Ingo Molnar @ 2015-06-04 12:40 UTC (permalink / raw)
  To: Wangnan (F)
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Alexei Starovoitov, Brendan Gregg, Daniel Borkmann, David Ahern,
	He Kuang, Jiri Olsa, Kaixu Xia, Madhavan Srinivasan,
	Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Peter Zijlstra,
	pi3orama, Sukadev Bhattiprolu, Zefan Li,
	Arnaldo Carvalho de Melo, Alexei Starovoitov


* Wangnan (F) <wangnan0@huawei.com> wrote:

> > So how do you generate the .o? Why cannot the tool, if it sees that the filter 
> > parameter is eBPF source code, do that automatically?
> 
> I think compiling on the fly is our goal, and Alexei is working on it.

So what exact command line are you using to create the .o?

What exactly should users type to create a simple eBPF filter profile?

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-06-04  7:21     ` Ingo Molnar
@ 2015-06-04 10:00       ` Wangnan (F)
  2015-06-04 12:40         ` Ingo Molnar
  0 siblings, 1 reply; 40+ messages in thread
From: Wangnan (F) @ 2015-06-04 10:00 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Alexei Starovoitov, Brendan Gregg, Daniel Borkmann, David Ahern,
	He Kuang, Jiri Olsa, Kaixu Xia, Madhavan Srinivasan,
	Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Peter Zijlstra,
	pi3orama, Sukadev Bhattiprolu, Zefan Li,
	Arnaldo Carvalho de Melo, Alexei Starovoitov



On 2015/6/4 15:21, Ingo Molnar wrote:
> * Wangnan (F) <wangnan0@huawei.com> wrote:
>
>> On 2015/6/4 13:48, Ingo Molnar wrote:
>>> * Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>>>
>>>> Hi Ingo,
>>>>
>>>> 	Please consider applying.
>>>>
>>>> 	One of the next requests probably will have the eBPF work by Wang Nan,
>>>> but I am still going thru it and want to test it thoroughly.
>>>>
>>>> 	BTW: Have you looked at it lately? It is at:
>>>>
>>>> http://lkml.kernel.org/r/1433144296-74992-1-git-send-email-wangnan0@huawei.com
>>>>
>>>> Super summary from the above cover letter:
>>>>
>>>> ---------------------
>>>> It enables 'perf record' to filter events using eBPF programs like:
>>>>
>>>>   # perf record --event bpf-file.o sleep 1
>>>>
>>>> Events are selected and filtered according to definitions in bpf-file.o.
>>> Looks useful, but I think the UI needs one more tweak: could you fix it to be able
>>> to filter based on the eBPF _source_ file, not just the object file?
>>>
>>> People want to tweak such filters as they profile, so we should use the eBPF
>>> source code as the primary interface. We can compile it internally to the .o just
>>> fine. The .o file is a totally uninteresting intermediate product in itself.
>>>
>>> I.e. we need to first think through such profiling workflows from beginning to end
>>> before allowing them upstream.
>> In a private mail Alexei Starovoitov disscussed with me about this. He said that
>> he is working on a shared object which can compile C program into BPF bytecode
>> on the fly. After he done his work, I think perf can support dtrace-like
>> profiling that, users will be able to feed source code to perf directly on
>> cmdline. He said he can release it on June. I added him to the CC-list.
>>
>> However I think the '.o' intermediate is still needed. [...]
> So how do you generate the .o? Why cannot the tool, if it sees that the filter
> parameter is eBPF source code, do that automatically?

I think compiling on the fly is our goal, and Alexei is working on it. 
However,
it looks like some limitations are still exist. For example, the BPF 
program may
require the definition of kernel structure for it to derefrernce struct 
pointers.
Therefore, the machine on which compiling occures should have kernel 
header and
configuration installed. However, most of production environment doesn't 
have
them for security and reasons.

I think BPF should be used to profile not only development environment 
but also
production systems. If we only concern development systems, why not 
recompiling
kernel with stub core or using kProbe modules?

What about this:

Give perf the ability to generate the '.o' file (to memory or dump to a 
real file)
on development environment. If we are willing to profiling that system, 
we can make
load the generated object into kernel and start trace by (perf record 
--event bpf_file.c ...).
If we are willing to profile systems on which the compiling environment 
is missing, we can
make perf to create a '.o' file (perf bpf compile bpf_file.c -o 
bpf_file.o) then copy
it onto target environment, use perf record --event bpf_file.o ... to 
filter events.

Thank you.

> I.e. you are making the user jump through hoops for no good reason - that's a bad
> UI and a bad workflow. Please don't do that!
>
> Thanks,
>
> 	Ingo



^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-06-04  6:07   ` Wangnan (F)
@ 2015-06-04  7:21     ` Ingo Molnar
  2015-06-04 10:00       ` Wangnan (F)
  0 siblings, 1 reply; 40+ messages in thread
From: Ingo Molnar @ 2015-06-04  7:21 UTC (permalink / raw)
  To: Wangnan (F)
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Adrian Hunter,
	Alexei Starovoitov, Brendan Gregg, Daniel Borkmann, David Ahern,
	He Kuang, Jiri Olsa, Kaixu Xia, Madhavan Srinivasan,
	Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Peter Zijlstra,
	pi3orama, Sukadev Bhattiprolu, Zefan Li,
	Arnaldo Carvalho de Melo, Alexei Starovoitov


* Wangnan (F) <wangnan0@huawei.com> wrote:

> On 2015/6/4 13:48, Ingo Molnar wrote:
> >* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> >
> >>Hi Ingo,
> >>
> >>	Please consider applying.
> >>
> >>	One of the next requests probably will have the eBPF work by Wang Nan,
> >>but I am still going thru it and want to test it thoroughly.
> >>
> >>	BTW: Have you looked at it lately? It is at:
> >>
> >>http://lkml.kernel.org/r/1433144296-74992-1-git-send-email-wangnan0@huawei.com
> >>
> >>Super summary from the above cover letter:
> >>
> >>---------------------
> >>It enables 'perf record' to filter events using eBPF programs like:
> >>
> >>  # perf record --event bpf-file.o sleep 1
> >>
> >>Events are selected and filtered according to definitions in bpf-file.o.
> >Looks useful, but I think the UI needs one more tweak: could you fix it to be able
> >to filter based on the eBPF _source_ file, not just the object file?
> >
> >People want to tweak such filters as they profile, so we should use the eBPF
> >source code as the primary interface. We can compile it internally to the .o just
> >fine. The .o file is a totally uninteresting intermediate product in itself.
> >
> >I.e. we need to first think through such profiling workflows from beginning to end
> >before allowing them upstream.
> 
> In a private mail Alexei Starovoitov disscussed with me about this. He said that 
> he is working on a shared object which can compile C program into BPF bytecode 
> on the fly. After he done his work, I think perf can support dtrace-like 
> profiling that, users will be able to feed source code to perf directly on 
> cmdline. He said he can release it on June. I added him to the CC-list.
> 
> However I think the '.o' intermediate is still needed. [...]

So how do you generate the .o? Why cannot the tool, if it sees that the filter 
parameter is eBPF source code, do that automatically?

I.e. you are making the user jump through hoops for no good reason - that's a bad 
UI and a bad workflow. Please don't do that!

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-06-04  5:48 ` Ingo Molnar
@ 2015-06-04  6:07   ` Wangnan (F)
  2015-06-04  7:21     ` Ingo Molnar
  0 siblings, 1 reply; 40+ messages in thread
From: Wangnan (F) @ 2015-06-04  6:07 UTC (permalink / raw)
  To: Ingo Molnar, Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexei Starovoitov, Brendan Gregg,
	Daniel Borkmann, David Ahern, He Kuang, Jiri Olsa, Kaixu Xia,
	Madhavan Srinivasan, Masami Hiramatsu, Michael Ellerman,
	Namhyung Kim, Peter Zijlstra, pi3orama, Sukadev Bhattiprolu,
	Zefan Li, Arnaldo Carvalho de Melo, Alexei Starovoitov,
	Alexei Starovoitov



On 2015/6/4 13:48, Ingo Molnar wrote:
> * Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>
>> Hi Ingo,
>>
>> 	Please consider applying.
>>
>> 	One of the next requests probably will have the eBPF work by Wang Nan,
>> but I am still going thru it and want to test it thoroughly.
>>
>> 	BTW: Have you looked at it lately? It is at:
>>
>> http://lkml.kernel.org/r/1433144296-74992-1-git-send-email-wangnan0@huawei.com
>>
>> Super summary from the above cover letter:
>>
>> ---------------------
>> It enables 'perf record' to filter events using eBPF programs like:
>>
>>   # perf record --event bpf-file.o sleep 1
>>
>> Events are selected and filtered according to definitions in bpf-file.o.
> Looks useful, but I think the UI needs one more tweak: could you fix it to be able
> to filter based on the eBPF _source_ file, not just the object file?
>
> People want to tweak such filters as they profile, so we should use the eBPF
> source code as the primary interface. We can compile it internally to the .o just
> fine. The .o file is a totally uninteresting intermediate product in itself.
>
> I.e. we need to first think through such profiling workflows from beginning to end
> before allowing them upstream.

In a private mail Alexei Starovoitov disscussed with me about this. He 
said that he is working
on a shared object which can compile C program into BPF bytecode on the 
fly. After he done his
work, I think perf can support dtrace-like profiling that, users will be 
able to feed source
code to perf directly on cmdline. He said he can release it on June. I 
added him to the CC-list.

However I think the '.o' intermediate is still needed. I'd like to share 
a real profiling
experience using eBPF today, please keep an eye on it. In my experience, 
since we are using C
instead of dtrace, the code piece could be relative complex. Therefore, 
even if perf is able
to compile the C source on the fly, I think user still need to transfer 
the profiling scripts
to the target machine. Therefor, for him, precompiling and do some 
debugging on a high-end server
then transfer it into target machine (like a smartphone) is tolerable, 
and useful for me.

Thank you.

>> ---------------------
>>
>> 	The first two patches from that series are in this pull req, as
>> they just move stuff into tools/include/linux/ from tools/perf/include.
>>
>> Regards,
>>
>> - Arnaldo
>>
>> The following changes since commit 5c9b9bc67c684e40b3a5e7e9facde0fb7200cd8c:
>>
>>    Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-05-29 20:19:02 +0200)
>>
>> are available in the git repository at:
>>
>>    git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
>>
>> for you to fetch changes up to 1f121b03d058dd07199d8924373d3c52a207f63b:
>>
>>    perf tools: Deal with kernel module names in '[]' correctly (2015-06-03 10:02:38 -0300)
>>
>> ----------------------------------------------------------------
>> perf/core improvements and fixes:
>>
>> User visible:
>>
>> - Fix 'perf probe' segfault when glob matching function without debuginfo (Wang Nan)
>>
>> - Remove newline char when reading event scale and unit (Madhavan Srinivasan)
>>
>> - Deal with kernel module names in '[]' correctly (Wang Nan)
>>
>> Infrastructure:
>>
>> - Fix the search for the kernel DSO on the unified list (Arnaldo Carvalho de Melo)
>>
>> - Move tools/perf/util/include/linux/{kernel.h,list.h,poison.h} to tools/include,
>>    to be used in tools/lib/bpf/ (Wang Nan)
>>
>> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>>
>> ----------------------------------------------------------------
>> Arnaldo Carvalho de Melo (1):
>>        perf machine: Fix the search for the kernel DSO on the unified list
>>
>> Madhavan Srinivasan (1):
>>        perf tools: Remove newline char when reading event scale and unit
>>
>> Wang Nan (4):
>>        perf probe: Fix segfault when glob matching function without debuginfo
>>        perf tools: Move linux/kernel.h to tools/include
>>        tools: Move tools/perf/util/include/linux/{list.h,poison.h} to tools/include
>>        perf tools: Deal with kernel module names in '[]' correctly
>>
>>   tools/{perf/util => }/include/linux/kernel.h |  4 +-
>>   tools/{perf/util => }/include/linux/list.h   |  6 +--
>>   tools/include/linux/poison.h                 |  1 +
>>   tools/perf/MANIFEST                          |  3 ++
>>   tools/perf/tests/kmod-path.c                 | 72 ++++++++++++++++++++++++++++
>>   tools/perf/util/dso.c                        | 47 ++++++++++++++++--
>>   tools/perf/util/dso.h                        |  2 +-
>>   tools/perf/util/header.c                     |  8 ++--
>>   tools/perf/util/include/linux/poison.h       |  1 -
>>   tools/perf/util/machine.c                    | 22 ++++++++-
>>   tools/perf/util/pmu.c                        | 11 ++++-
>>   tools/perf/util/probe-event.c                | 26 ++++++++--
>>   12 files changed, 179 insertions(+), 24 deletions(-)
>>   rename tools/{perf/util => }/include/linux/kernel.h (97%)
>>   rename tools/{perf/util => }/include/linux/list.h (90%)
>>   create mode 100644 tools/include/linux/poison.h
>>   delete mode 100644 tools/perf/util/include/linux/poison.h
> Pulled, thanks a lot Arnaldo!
>
> 	Ingo



^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-06-03 22:40 Arnaldo Carvalho de Melo
@ 2015-06-04  5:48 ` Ingo Molnar
  2015-06-04  6:07   ` Wangnan (F)
  0 siblings, 1 reply; 40+ messages in thread
From: Ingo Molnar @ 2015-06-04  5:48 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Alexei Starovoitov, Brendan Gregg,
	Daniel Borkmann, David Ahern, He Kuang, Jiri Olsa, Kaixu Xia,
	Madhavan Srinivasan, Masami Hiramatsu, Michael Ellerman,
	Namhyung Kim, Peter Zijlstra, pi3orama, Sukadev Bhattiprolu,
	Wang Nan, Zefan Li, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider applying.
> 
> 	One of the next requests probably will have the eBPF work by Wang Nan,
> but I am still going thru it and want to test it thoroughly.
> 
> 	BTW: Have you looked at it lately? It is at:
> 
> http://lkml.kernel.org/r/1433144296-74992-1-git-send-email-wangnan0@huawei.com
> 
> Super summary from the above cover letter:
> 
> ---------------------
> It enables 'perf record' to filter events using eBPF programs like:
> 
>  # perf record --event bpf-file.o sleep 1
> 
> Events are selected and filtered according to definitions in bpf-file.o.

Looks useful, but I think the UI needs one more tweak: could you fix it to be able 
to filter based on the eBPF _source_ file, not just the object file?

People want to tweak such filters as they profile, so we should use the eBPF 
source code as the primary interface. We can compile it internally to the .o just 
fine. The .o file is a totally uninteresting intermediate product in itself.

I.e. we need to first think through such profiling workflows from beginning to end 
before allowing them upstream.

> ---------------------
> 
> 	The first two patches from that series are in this pull req, as
> they just move stuff into tools/include/linux/ from tools/perf/include.
> 
> Regards,
> 
> - Arnaldo
> 
> The following changes since commit 5c9b9bc67c684e40b3a5e7e9facde0fb7200cd8c:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-05-29 20:19:02 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
> 
> for you to fetch changes up to 1f121b03d058dd07199d8924373d3c52a207f63b:
> 
>   perf tools: Deal with kernel module names in '[]' correctly (2015-06-03 10:02:38 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Fix 'perf probe' segfault when glob matching function without debuginfo (Wang Nan)
> 
> - Remove newline char when reading event scale and unit (Madhavan Srinivasan)
> 
> - Deal with kernel module names in '[]' correctly (Wang Nan)
> 
> Infrastructure:
> 
> - Fix the search for the kernel DSO on the unified list (Arnaldo Carvalho de Melo)
> 
> - Move tools/perf/util/include/linux/{kernel.h,list.h,poison.h} to tools/include,
>   to be used in tools/lib/bpf/ (Wang Nan)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (1):
>       perf machine: Fix the search for the kernel DSO on the unified list
> 
> Madhavan Srinivasan (1):
>       perf tools: Remove newline char when reading event scale and unit
> 
> Wang Nan (4):
>       perf probe: Fix segfault when glob matching function without debuginfo
>       perf tools: Move linux/kernel.h to tools/include
>       tools: Move tools/perf/util/include/linux/{list.h,poison.h} to tools/include
>       perf tools: Deal with kernel module names in '[]' correctly
> 
>  tools/{perf/util => }/include/linux/kernel.h |  4 +-
>  tools/{perf/util => }/include/linux/list.h   |  6 +--
>  tools/include/linux/poison.h                 |  1 +
>  tools/perf/MANIFEST                          |  3 ++
>  tools/perf/tests/kmod-path.c                 | 72 ++++++++++++++++++++++++++++
>  tools/perf/util/dso.c                        | 47 ++++++++++++++++--
>  tools/perf/util/dso.h                        |  2 +-
>  tools/perf/util/header.c                     |  8 ++--
>  tools/perf/util/include/linux/poison.h       |  1 -
>  tools/perf/util/machine.c                    | 22 ++++++++-
>  tools/perf/util/pmu.c                        | 11 ++++-
>  tools/perf/util/probe-event.c                | 26 ++++++++--
>  12 files changed, 179 insertions(+), 24 deletions(-)
>  rename tools/{perf/util => }/include/linux/kernel.h (97%)
>  rename tools/{perf/util => }/include/linux/list.h (90%)
>  create mode 100644 tools/include/linux/poison.h
>  delete mode 100644 tools/perf/util/include/linux/poison.h

Pulled, thanks a lot Arnaldo!

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [GIT PULL 0/6] perf/core improvements and fixes
@ 2015-06-03 22:40 Arnaldo Carvalho de Melo
  2015-06-04  5:48 ` Ingo Molnar
  0 siblings, 1 reply; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-06-03 22:40 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Alexei Starovoitov, Brendan Gregg, Daniel Borkmann, David Ahern,
	He Kuang, Jiri Olsa, Kaixu Xia, Madhavan Srinivasan,
	Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Peter Zijlstra,
	pi3orama, Sukadev Bhattiprolu, Wang Nan, Zefan Li,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider applying.

	One of the next requests probably will have the eBPF work by Wang Nan,
but I am still going thru it and want to test it thoroughly.

	BTW: Have you looked at it lately? It is at:

http://lkml.kernel.org/r/1433144296-74992-1-git-send-email-wangnan0@huawei.com

Super summary from the above cover letter:

---------------------
It enables 'perf record' to filter events using eBPF programs like:

 # perf record --event bpf-file.o sleep 1

Events are selected and filtered according to definitions in bpf-file.o.
---------------------

	The first two patches from that series are in this pull req, as
they just move stuff into tools/include/linux/ from tools/perf/include.

Regards,

- Arnaldo

The following changes since commit 5c9b9bc67c684e40b3a5e7e9facde0fb7200cd8c:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-05-29 20:19:02 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo

for you to fetch changes up to 1f121b03d058dd07199d8924373d3c52a207f63b:

  perf tools: Deal with kernel module names in '[]' correctly (2015-06-03 10:02:38 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

User visible:

- Fix 'perf probe' segfault when glob matching function without debuginfo (Wang Nan)

- Remove newline char when reading event scale and unit (Madhavan Srinivasan)

- Deal with kernel module names in '[]' correctly (Wang Nan)

Infrastructure:

- Fix the search for the kernel DSO on the unified list (Arnaldo Carvalho de Melo)

- Move tools/perf/util/include/linux/{kernel.h,list.h,poison.h} to tools/include,
  to be used in tools/lib/bpf/ (Wang Nan)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Arnaldo Carvalho de Melo (1):
      perf machine: Fix the search for the kernel DSO on the unified list

Madhavan Srinivasan (1):
      perf tools: Remove newline char when reading event scale and unit

Wang Nan (4):
      perf probe: Fix segfault when glob matching function without debuginfo
      perf tools: Move linux/kernel.h to tools/include
      tools: Move tools/perf/util/include/linux/{list.h,poison.h} to tools/include
      perf tools: Deal with kernel module names in '[]' correctly

 tools/{perf/util => }/include/linux/kernel.h |  4 +-
 tools/{perf/util => }/include/linux/list.h   |  6 +--
 tools/include/linux/poison.h                 |  1 +
 tools/perf/MANIFEST                          |  3 ++
 tools/perf/tests/kmod-path.c                 | 72 ++++++++++++++++++++++++++++
 tools/perf/util/dso.c                        | 47 ++++++++++++++++--
 tools/perf/util/dso.h                        |  2 +-
 tools/perf/util/header.c                     |  8 ++--
 tools/perf/util/include/linux/poison.h       |  1 -
 tools/perf/util/machine.c                    | 22 ++++++++-
 tools/perf/util/pmu.c                        | 11 ++++-
 tools/perf/util/probe-event.c                | 26 ++++++++--
 12 files changed, 179 insertions(+), 24 deletions(-)
 rename tools/{perf/util => }/include/linux/kernel.h (97%)
 rename tools/{perf/util => }/include/linux/list.h (90%)
 create mode 100644 tools/include/linux/poison.h
 delete mode 100644 tools/perf/util/include/linux/poison.h

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-03-31 20:59 Arnaldo Carvalho de Melo
@ 2015-04-01  7:56 ` Ingo Molnar
  0 siblings, 0 replies; 40+ messages in thread
From: Ingo Molnar @ 2015-04-01  7:56 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Andi Kleen, Borislav Petkov,
	David Ahern, David Hildenbrand, Don Zickus, Frederic Weisbecker,
	Hendrik Brueckner, Jeremie Galarneau, Jiri Olsa, Joe Mario,
	Kan Liang, Martin Schwidefsky, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Sebastian Andrzej Siewior, Stephane Eranian,
	Tom Zanussi, Wang Nan, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit ccd41c86ad4d464d0ed4e48d80759ff85c2115b0:
> 
>   perf: Fix racy group access (2015-03-27 09:49:45 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
> 
> for you to fetch changes up to 9870d7809575515e26194f4b3df1750872a6ee60:
> 
>   perf ordered_samples: Remove references to perf_{evlist,tool} and machines (2015-03-31 17:52:32 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Fix 'perf script' pipe mode segfault, by always initializing ordered_events in
>   perf_session__new. (Arnaldo Carvalho de Melo)
> 
> - Fix ppid for synthesized fork events (David Ahern)
> 
> - Fix kernel symbol resolution of callchains in S/390 by remembering the
>   cpumode. (David Hildenbrand)
> 
> Infrastructure:
> 
> - Disable libbabeltrace check by default in the build system (Jiri Olsa)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (2):
>       perf session: Always initialize ordered_events
>       perf ordered_samples: Remove references to perf_{evlist,tool} and machines
> 
> David Ahern (2):
>       perf tools: Refactor comm/tgid lookup
>       perf tools: Fix ppid for synthesized fork events
> 
> David Hildenbrand (1):
>       perf callchain: Fix kernel symbol resolution by remembering the cpumode
> 
> Jiri Olsa (1):
>       perf build: Disable libbabeltrace check by default
> 
>  tools/perf/Makefile.perf         |   2 +-
>  tools/perf/config/Makefile       |   5 +-
>  tools/perf/util/event.c          | 147 ++++++++++++++++++++++++---------------
>  tools/perf/util/event.h          |   1 -
>  tools/perf/util/machine.c        |  28 ++++----
>  tools/perf/util/ordered-events.c |  21 ++----
>  tools/perf/util/ordered-events.h |  14 +---
>  tools/perf/util/session.c        |  48 ++++++++-----
>  tools/perf/util/session.h        |   1 +
>  9 files changed, 144 insertions(+), 123 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [GIT PULL 0/6] perf/core improvements and fixes
@ 2015-03-31 20:59 Arnaldo Carvalho de Melo
  2015-04-01  7:56 ` Ingo Molnar
  0 siblings, 1 reply; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-31 20:59 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Andi Kleen, Borislav Petkov, David Ahern, David Hildenbrand,
	Don Zickus, Frederic Weisbecker, Hendrik Brueckner,
	Jeremie Galarneau, Jiri Olsa, Joe Mario, Kan Liang,
	Martin Schwidefsky, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Sebastian Andrzej Siewior, Stephane Eranian, Tom Zanussi,
	Wang Nan, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit ccd41c86ad4d464d0ed4e48d80759ff85c2115b0:

  perf: Fix racy group access (2015-03-27 09:49:45 +0100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo

for you to fetch changes up to 9870d7809575515e26194f4b3df1750872a6ee60:

  perf ordered_samples: Remove references to perf_{evlist,tool} and machines (2015-03-31 17:52:32 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

User visible:

- Fix 'perf script' pipe mode segfault, by always initializing ordered_events in
  perf_session__new. (Arnaldo Carvalho de Melo)

- Fix ppid for synthesized fork events (David Ahern)

- Fix kernel symbol resolution of callchains in S/390 by remembering the
  cpumode. (David Hildenbrand)

Infrastructure:

- Disable libbabeltrace check by default in the build system (Jiri Olsa)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Arnaldo Carvalho de Melo (2):
      perf session: Always initialize ordered_events
      perf ordered_samples: Remove references to perf_{evlist,tool} and machines

David Ahern (2):
      perf tools: Refactor comm/tgid lookup
      perf tools: Fix ppid for synthesized fork events

David Hildenbrand (1):
      perf callchain: Fix kernel symbol resolution by remembering the cpumode

Jiri Olsa (1):
      perf build: Disable libbabeltrace check by default

 tools/perf/Makefile.perf         |   2 +-
 tools/perf/config/Makefile       |   5 +-
 tools/perf/util/event.c          | 147 ++++++++++++++++++++++++---------------
 tools/perf/util/event.h          |   1 -
 tools/perf/util/machine.c        |  28 ++++----
 tools/perf/util/ordered-events.c |  21 ++----
 tools/perf/util/ordered-events.h |  14 +---
 tools/perf/util/session.c        |  48 ++++++++-----
 tools/perf/util/session.h        |   1 +
 9 files changed, 144 insertions(+), 123 deletions(-)

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2015-03-26 15:40 Arnaldo Carvalho de Melo
@ 2015-03-27  7:37 ` Ingo Molnar
  0 siblings, 0 replies; 40+ messages in thread
From: Ingo Molnar @ 2015-03-27  7:37 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Adrian Hunter, Borislav Petkov, David Ahern,
	David Ahern, Don Zickus, Frederic Weisbecker, Guilherme Cox,
	Jiri Olsa, Jiri Olsa, Namhyung Kim, Stephane Eranian,
	Steven Rostedt, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit baa5a7bc5dd069bb37de9c8bdb5ea7f4e2e939e9:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-03-24 17:22:44 +0100)
> 
> are available in the git repository at:
> 
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
> 
> for you to fetch changes up to 7c27f78a297b54c3c2f5075cb15d33431b7f6333:
> 
>   tools lib traceevent: Zero should not be considered "not found" in eval_flag() (2015-03-26 10:52:29 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Show the first event with an invalid filter (David Ahern, Arnaldo Carvalho de Melo)
> 
> - Fix garbage output when intermixing syscalls from different threads in 'perf trace' (Arnaldo Carvalho de Melo)
> 
> - Fix 'perf timechart' SIBGUS error on sparc64 (David Ahern)
> 
> Infrastructure:
> 
> - Set JOBS based on CPU or processor, making it work on SPARC, where
>   /proc/cpuinfo has "CPU", not "processor" (David Ahern)
> 
> - Zero should not be considered "not found" in libtraceevent's eval_flag() (Steven Rostedt)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (2):
>       perf evlist: Return the first evsel with an invalid filter in apply_filters()
>       perf trace: Fix syscall enter formatting bug
> 
> David Ahern (3):
>       perf timechart: Fix SIBGUS error on sparc64
>       perf: Bump max number of cpus to 1024
>       perf tools: Set JOBS based on CPU or processor
> 
> Steven Rostedt (1):
>       tools lib traceevent: Zero should not be considered "not found" in eval_flag()
> 
>  tools/lib/traceevent/event-parse.c | 10 +++++-----
>  tools/perf/Makefile                |  2 +-
>  tools/perf/builtin-record.c        |  5 +++--
>  tools/perf/builtin-stat.c          |  5 +++--
>  tools/perf/builtin-trace.c         |  2 +-
>  tools/perf/perf.h                  |  2 +-
>  tools/perf/util/evlist.c           |  6 ++++--
>  tools/perf/util/evlist.h           |  2 +-
>  tools/perf/util/evsel.c            |  2 +-
>  9 files changed, 20 insertions(+), 16 deletions(-)

Pulled, thanks a lot Arnaldo!

Btw., I still see:

config/Makefile:609: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev

this annoyance needs to be fixed ASAP, before I can send perf/core to 
Linus.

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [GIT PULL 0/6] perf/core improvements and fixes
@ 2015-03-26 15:40 Arnaldo Carvalho de Melo
  2015-03-27  7:37 ` Ingo Molnar
  0 siblings, 1 reply; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-26 15:40 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Borislav Petkov, David Ahern, David Ahern, Don Zickus,
	Frederic Weisbecker, Guilherme Cox, Jiri Olsa, Jiri Olsa,
	Namhyung Kim, Stephane Eranian, Steven Rostedt,
	Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit baa5a7bc5dd069bb37de9c8bdb5ea7f4e2e939e9:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-03-24 17:22:44 +0100)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo

for you to fetch changes up to 7c27f78a297b54c3c2f5075cb15d33431b7f6333:

  tools lib traceevent: Zero should not be considered "not found" in eval_flag() (2015-03-26 10:52:29 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

User visible:

- Show the first event with an invalid filter (David Ahern, Arnaldo Carvalho de Melo)

- Fix garbage output when intermixing syscalls from different threads in 'perf trace' (Arnaldo Carvalho de Melo)

- Fix 'perf timechart' SIBGUS error on sparc64 (David Ahern)

Infrastructure:

- Set JOBS based on CPU or processor, making it work on SPARC, where
  /proc/cpuinfo has "CPU", not "processor" (David Ahern)

- Zero should not be considered "not found" in libtraceevent's eval_flag() (Steven Rostedt)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Arnaldo Carvalho de Melo (2):
      perf evlist: Return the first evsel with an invalid filter in apply_filters()
      perf trace: Fix syscall enter formatting bug

David Ahern (3):
      perf timechart: Fix SIBGUS error on sparc64
      perf: Bump max number of cpus to 1024
      perf tools: Set JOBS based on CPU or processor

Steven Rostedt (1):
      tools lib traceevent: Zero should not be considered "not found" in eval_flag()

 tools/lib/traceevent/event-parse.c | 10 +++++-----
 tools/perf/Makefile                |  2 +-
 tools/perf/builtin-record.c        |  5 +++--
 tools/perf/builtin-stat.c          |  5 +++--
 tools/perf/builtin-trace.c         |  2 +-
 tools/perf/perf.h                  |  2 +-
 tools/perf/util/evlist.c           |  6 ++++--
 tools/perf/util/evlist.h           |  2 +-
 tools/perf/util/evsel.c            |  2 +-
 9 files changed, 20 insertions(+), 16 deletions(-)

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2014-05-12  9:27 Jiri Olsa
@ 2014-05-12 15:59 ` Ingo Molnar
  0 siblings, 0 replies; 40+ messages in thread
From: Ingo Molnar @ 2014-05-12 15:59 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: linux-kernel, Adrian Hunter, Arnaldo Carvalho de Melo,
	Bernhard Rosenkraenzer, Corey Ashford, David Ahern, Dongsheng,
	Frederic Weisbecker, Irina Tirdea, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian


* Jiri Olsa <jolsa@kernel.org> wrote:

> hi Ingo,
> please consider pulling
> 
> thanks,
> jirka
> 
> 
> The following changes since commit 3e46d21285577a8c9e4c37f9b1002e567c440b28:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf into perf/core (2014-05-05 19:37:51 +0200)
> 
> are available in the git repository at:
> 
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git tags/perf-core-for-mingo
> 
> for you to fetch changes up to 13ce34df11833482cd698331fdbb3f8ced06340d:
> 
>   perf tools: Use tid for finding thread (2014-05-12 11:09:50 +0200)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> . Propagate exit status of a command line workload for
>   record command (Namhyung Kim)
> 
> . Use tid for finding thread (Namhyung Kim)
> 
> . Clarify the output of perf sched map plus small sched
>   command fixies (Dongsheng Yang)
> 
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> 
> ----------------------------------------------------------------
> Dongsheng (3):
>       perf tools: Add missing event for perf sched record.
>       perf tools: Adapt the TASK_STATE_TO_CHAR_STR to new value in kernel space.
>       perf tools: Clarify the output of perf sched map.
> 
> Namhyung Kim (3):
>       perf record: Propagate exit status of a command line workload
>       perf tools: Get rid of on_exit() feature test
>       perf tools: Use tid for finding thread
> 
>  tools/perf/builtin-inject.c                     |   2 +-
>  tools/perf/builtin-kmem.c                       |   2 +-
>  tools/perf/builtin-record.c                     | 158 +++++++++---------------
>  tools/perf/builtin-sched.c                      |  38 +++---
>  tools/perf/config/Makefile                      |   8 --
>  tools/perf/config/feature-checks/Makefile       |   4 -
>  tools/perf/config/feature-checks/test-all.c     |   5 -
>  tools/perf/config/feature-checks/test-on-exit.c |  16 ---
>  tools/perf/tests/code-reading.c                 |   2 +-
>  tools/perf/tests/hists_filter.c                 |   1 +
>  tools/perf/tests/hists_link.c                   |   2 +
>  tools/perf/util/build-id.c                      |   2 +-
>  tools/perf/util/event.c                         |   2 +-
>  13 files changed, 90 insertions(+), 152 deletions(-)
>  delete mode 100644 tools/perf/config/feature-checks/test-on-exit.c

Pulled, thanks a lot Jiri!

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [GIT PULL 0/6] perf/core improvements and fixes
@ 2014-05-12  9:27 Jiri Olsa
  2014-05-12 15:59 ` Ingo Molnar
  0 siblings, 1 reply; 40+ messages in thread
From: Jiri Olsa @ 2014-05-12  9:27 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Adrian Hunter, Arnaldo Carvalho de Melo,
	Bernhard Rosenkraenzer, Corey Ashford, David Ahern, Dongsheng,
	Frederic Weisbecker, Irina Tirdea, Jiri Olsa, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian

hi Ingo,
please consider pulling

thanks,
jirka


The following changes since commit 3e46d21285577a8c9e4c37f9b1002e567c440b28:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf into perf/core (2014-05-05 19:37:51 +0200)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git tags/perf-core-for-mingo

for you to fetch changes up to 13ce34df11833482cd698331fdbb3f8ced06340d:

  perf tools: Use tid for finding thread (2014-05-12 11:09:50 +0200)

----------------------------------------------------------------
perf/core improvements and fixes:

. Propagate exit status of a command line workload for
  record command (Namhyung Kim)

. Use tid for finding thread (Namhyung Kim)

. Clarify the output of perf sched map plus small sched
  command fixies (Dongsheng Yang)

Signed-off-by: Jiri Olsa <jolsa@kernel.org>

----------------------------------------------------------------
Dongsheng (3):
      perf tools: Add missing event for perf sched record.
      perf tools: Adapt the TASK_STATE_TO_CHAR_STR to new value in kernel space.
      perf tools: Clarify the output of perf sched map.

Namhyung Kim (3):
      perf record: Propagate exit status of a command line workload
      perf tools: Get rid of on_exit() feature test
      perf tools: Use tid for finding thread

 tools/perf/builtin-inject.c                     |   2 +-
 tools/perf/builtin-kmem.c                       |   2 +-
 tools/perf/builtin-record.c                     | 158 +++++++++---------------
 tools/perf/builtin-sched.c                      |  38 +++---
 tools/perf/config/Makefile                      |   8 --
 tools/perf/config/feature-checks/Makefile       |   4 -
 tools/perf/config/feature-checks/test-all.c     |   5 -
 tools/perf/config/feature-checks/test-on-exit.c |  16 ---
 tools/perf/tests/code-reading.c                 |   2 +-
 tools/perf/tests/hists_filter.c                 |   1 +
 tools/perf/tests/hists_link.c                   |   2 +
 tools/perf/util/build-id.c                      |   2 +-
 tools/perf/util/event.c                         |   2 +-
 13 files changed, 90 insertions(+), 152 deletions(-)
 delete mode 100644 tools/perf/config/feature-checks/test-on-exit.c

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2014-04-30 10:11 Jiri Olsa
@ 2014-05-01  6:26 ` Ingo Molnar
  0 siblings, 0 replies; 40+ messages in thread
From: Ingo Molnar @ 2014-05-01  6:26 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Alexander Yarygin, Arnaldo Carvalho de Melo, Borislav Petkov,
	Christian Borntraeger, Corey Ashford, David Ahern,
	Frederic Weisbecker, Jean Pihet, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian, Will Deacon, linux-kernel


* Jiri Olsa <jolsa@kernel.org> wrote:

> hi Ingo,
> please consider pulling
> 
> resending 0/6.. it got lost somehow from previous post..
> 
> thanks,
> jirka
> 
> 
> The following changes since commit 201131998fbf074b03679afedcc29948e63331ef:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf into perf/core (2014-04-29 08:41:21 +0200)
> 
> are available in the git repository at:
> 
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git tags/perf-core-for-mingo
> 
> for you to fetch changes up to 8ab596afb97bc9e2f9140dc1d993e81749acff42:
> 
>   perf tools ARM64: Wire up perf_regs and unwind support (2014-04-29 15:31:19 +0200)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> . Wire up perf_regs and unwind support for ARM64 (Jean Pihet)
> 
> . Move u64_swap union to its single user's header, evsel.h (Borislav Petkov)
> 
> . Fix for s390 to properly parse tracepoints plus test code (Alexander Yarygin)
> 
> . Handle EINTR error for readn/writen (Namhyung Kim)
> 
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> 
> ----------------------------------------------------------------
> Alexander Yarygin (3):
>       perf tools: Parse tracepoints with '-' in system name
>       perf tests: Add numeric identifier to evlist_test
>       perf tests: Add a test of kvm-390: trace event
> 
> Borislav Petkov (1):
>       perf tools: Move u64_swap union
> 
> Jean Pihet (1):
>       perf tools ARM64: Wire up perf_regs and unwind support
> 
> Namhyung Kim (1):
>       perf tools: Handle EINTR error for readn/writen
> 
>  tools/perf/arch/arm64/Makefile                |   7 ++
>  tools/perf/arch/arm64/include/perf_regs.h     |  88 ++++++++++++++++
>  tools/perf/arch/arm64/util/dwarf-regs.c       |  80 +++++++++++++++
>  tools/perf/arch/arm64/util/unwind-libunwind.c |  82 +++++++++++++++
>  tools/perf/config/Makefile                    |   8 +-
>  tools/perf/tests/parse-events.c               | 142 ++++++++++++++++++--------
>  tools/perf/util/evsel.h                       |   5 +
>  tools/perf/util/parse-events.y                |  12 +++
>  tools/perf/util/types.h                       |   5 -
>  tools/perf/util/util.c                        |   2 +
>  10 files changed, 380 insertions(+), 51 deletions(-)
>  create mode 100644 tools/perf/arch/arm64/Makefile
>  create mode 100644 tools/perf/arch/arm64/include/perf_regs.h
>  create mode 100644 tools/perf/arch/arm64/util/dwarf-regs.c
>  create mode 100644 tools/perf/arch/arm64/util/unwind-libunwind.c

Pulled, thanks a lot Jiri!

I also merged perf/urgent into perf/core, because a conflict developed 
between the two.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [GIT PULL 0/6] perf/core improvements and fixes
@ 2014-04-30 10:11 Jiri Olsa
  2014-05-01  6:26 ` Ingo Molnar
  0 siblings, 1 reply; 40+ messages in thread
From: Jiri Olsa @ 2014-04-30 10:11 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Alexander Yarygin, Arnaldo Carvalho de Melo, Borislav Petkov,
	Christian Borntraeger, Corey Ashford, David Ahern,
	Frederic Weisbecker, Ingo Molnar, Jean Pihet, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian, Will Deacon,
	linux-kernel

hi Ingo,
please consider pulling

resending 0/6.. it got lost somehow from previous post..

thanks,
jirka


The following changes since commit 201131998fbf074b03679afedcc29948e63331ef:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf into perf/core (2014-04-29 08:41:21 +0200)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git tags/perf-core-for-mingo

for you to fetch changes up to 8ab596afb97bc9e2f9140dc1d993e81749acff42:

  perf tools ARM64: Wire up perf_regs and unwind support (2014-04-29 15:31:19 +0200)

----------------------------------------------------------------
perf/core improvements and fixes:

. Wire up perf_regs and unwind support for ARM64 (Jean Pihet)

. Move u64_swap union to its single user's header, evsel.h (Borislav Petkov)

. Fix for s390 to properly parse tracepoints plus test code (Alexander Yarygin)

. Handle EINTR error for readn/writen (Namhyung Kim)

Signed-off-by: Jiri Olsa <jolsa@kernel.org>

----------------------------------------------------------------
Alexander Yarygin (3):
      perf tools: Parse tracepoints with '-' in system name
      perf tests: Add numeric identifier to evlist_test
      perf tests: Add a test of kvm-390: trace event

Borislav Petkov (1):
      perf tools: Move u64_swap union

Jean Pihet (1):
      perf tools ARM64: Wire up perf_regs and unwind support

Namhyung Kim (1):
      perf tools: Handle EINTR error for readn/writen

 tools/perf/arch/arm64/Makefile                |   7 ++
 tools/perf/arch/arm64/include/perf_regs.h     |  88 ++++++++++++++++
 tools/perf/arch/arm64/util/dwarf-regs.c       |  80 +++++++++++++++
 tools/perf/arch/arm64/util/unwind-libunwind.c |  82 +++++++++++++++
 tools/perf/config/Makefile                    |   8 +-
 tools/perf/tests/parse-events.c               | 142 ++++++++++++++++++--------
 tools/perf/util/evsel.h                       |   5 +
 tools/perf/util/parse-events.y                |  12 +++
 tools/perf/util/types.h                       |   5 -
 tools/perf/util/util.c                        |   2 +
 10 files changed, 380 insertions(+), 51 deletions(-)
 create mode 100644 tools/perf/arch/arm64/Makefile
 create mode 100644 tools/perf/arch/arm64/include/perf_regs.h
 create mode 100644 tools/perf/arch/arm64/util/dwarf-regs.c
 create mode 100644 tools/perf/arch/arm64/util/unwind-libunwind.c

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [GIT PULL 0/6] perf/core improvements and fixes
@ 2012-10-31 14:48 Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-10-31 14:48 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Andi Kleen, Andrew Vagin,
	Borislav Petkov, David Ahern, David Howells, Frederic Weisbecker,
	Irina Tirdea, Jiri Olsa, Joonsoo Kim, Mike Galbraith,
	Namhyung Kim, Namhyung Kim, Paul Mackerras, Pekka Enberg,
	Peter Zijlstra, Peter Zijlstra, Stephane Eranian, Steven Rostedt,
	arnaldo.melo, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 95d18aa2b6c05351181934b3bc34ce038cc7b637:

  perf/x86: Fix sparse warnings (2012-10-30 10:10:52 +0100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo

for you to fetch changes up to ffadcf090d468e9c4938b718649f38dd10cfdb02:

  perf annotate: Handle XBEGIN like a jump (2012-10-31 12:18:26 -0200)

----------------------------------------------------------------
perf/core improvements and fixes

. Handle XBEGIN like a jump in the annotate browser, from Andi Kleen

. Build speedups for --version, from Ingo Molnar.

. Add info about cross compiling for Android ARM, from Joonsoo Kim.

. Warn about missing libelf, from Namhyung Kim.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Andi Kleen (1):
      perf annotate: Handle XBEGIN like a jump

Arnaldo Carvalho de Melo (1):
      perf tools: Handle --version string generation on machines without git

Ingo Molnar (2):
      perf tools: Speed up the perf build time by simplifying the perf --version string generation
      perf tools: Further speed up the perf build

Joonsoo Kim (1):
      perf tools: Add info about cross compiling for Android ARM

Namhyung Kim (1):
      perf tools: Warn about missing libelf

 tools/perf/Documentation/android.txt |    5 ++++-
 tools/perf/Makefile                  |    2 ++
 tools/perf/util/PERF-VERSION-GEN     |   14 +++++---------
 tools/perf/util/annotate.c           |    2 ++
 4 files changed, 13 insertions(+), 10 deletions(-)

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [GIT PULL 0/6] perf/core improvements and fixes
  2011-02-16 22:54 Arnaldo Carvalho de Melo
@ 2011-02-17 13:50 ` Ingo Molnar
  0 siblings, 0 replies; 40+ messages in thread
From: Ingo Molnar @ 2011-02-17 13:50 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, 2nddept-manager, Franck Bui-Huu,
	Frederic Weisbecker, Jesse Brandeburg, Masami Hiramatsu,
	Mike Galbraith, Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	Tom Zanussi, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:

> Hi Ingo,
> 
>         Please consider pulling from:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf/core
> 
> Regards,
> 
> - Arnaldo
> 
> Arnaldo Carvalho de Melo (3):
>   perf ui: Serialize screen updates
>   perf annotate: Check if offset is less than symbol size
>   perf annotate browser: Use the percent color for the whole line
> 
> Jesse Brandeburg (1):
>   perf tools: Update Makefile with some help
> 
> Masami Hiramatsu (2):
>   perf probe: Support function@filename syntax for --line
>   perf probe: Show filename which contains target function
> 
>  tools/perf/Documentation/Makefile       |   19 ++++++++++---------
>  tools/perf/Documentation/perf-probe.txt |    7 ++++---
>  tools/perf/Makefile                     |   31 +++++++++++++++++++++++++++++++
>  tools/perf/util/annotate.c              |    3 ++-
>  tools/perf/util/probe-event.c           |   17 +++++++++++++----
>  tools/perf/util/ui/browser.c            |    7 +++++++
>  tools/perf/util/ui/browsers/annotate.c  |    5 +++--
>  tools/perf/util/ui/helpline.c           |    5 ++++-
>  tools/perf/util/ui/setup.c              |    3 +++
>  tools/perf/util/ui/ui.h                 |    8 ++++++++
>  10 files changed, 85 insertions(+), 20 deletions(-)
>  create mode 100644 tools/perf/util/ui/ui.h

Pulled, thanks a lot Arnaldo!

	Ingo

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [GIT PULL 0/6] perf/core improvements and fixes
@ 2011-02-16 22:54 Arnaldo Carvalho de Melo
  2011-02-17 13:50 ` Ingo Molnar
  0 siblings, 1 reply; 40+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-02-16 22:54 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, 2nddept-manager,
	Franck Bui-Huu, Frederic Weisbecker, Ingo Molnar,
	Jesse Brandeburg, Masami Hiramatsu, Mike Galbraith,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian, Tom Zanussi,
	Arnaldo Carvalho de Melo

Hi Ingo,

        Please consider pulling from:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf/core

Regards,

- Arnaldo

Arnaldo Carvalho de Melo (3):
  perf ui: Serialize screen updates
  perf annotate: Check if offset is less than symbol size
  perf annotate browser: Use the percent color for the whole line

Jesse Brandeburg (1):
  perf tools: Update Makefile with some help

Masami Hiramatsu (2):
  perf probe: Support function@filename syntax for --line
  perf probe: Show filename which contains target function

 tools/perf/Documentation/Makefile       |   19 ++++++++++---------
 tools/perf/Documentation/perf-probe.txt |    7 ++++---
 tools/perf/Makefile                     |   31 +++++++++++++++++++++++++++++++
 tools/perf/util/annotate.c              |    3 ++-
 tools/perf/util/probe-event.c           |   17 +++++++++++++----
 tools/perf/util/ui/browser.c            |    7 +++++++
 tools/perf/util/ui/browsers/annotate.c  |    5 +++--
 tools/perf/util/ui/helpline.c           |    5 ++++-
 tools/perf/util/ui/setup.c              |    3 +++
 tools/perf/util/ui/ui.h                 |    8 ++++++++
 10 files changed, 85 insertions(+), 20 deletions(-)
 create mode 100644 tools/perf/util/ui/ui.h


^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2017-03-16 16:30 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-20 16:23 [GIT PULL 0/6] perf/core improvements and fixes Arnaldo Carvalho de Melo
2011-04-20 16:23 ` [PATCH 1/6] perf symbols: Give more useful names to 'self' parameters Arnaldo Carvalho de Melo
2011-04-20 16:23 ` [PATCH 2/6] perf tools: Makefile: Clean up `python/perf.so' rule Arnaldo Carvalho de Melo
2011-04-20 16:23 ` [PATCH 3/6] perf tools: Makefile: PYTHON{,_CONFIG} to bandage Python 3 incompatibility Arnaldo Carvalho de Melo
2011-04-20 16:23 ` [PATCH 4/6] perf tools: Move `try-cc' Arnaldo Carvalho de Melo
2011-04-20 16:23 ` [PATCH 5/6] perf tools: git mv tools/perf/{features-tests.mak,config/} Arnaldo Carvalho de Melo
2011-04-20 16:23 ` [PATCH 6/6] perf script: Add support for PERF_TYPE_RAW Arnaldo Carvalho de Melo
2011-04-21  8:58 ` [GIT PULL 0/6] perf/core improvements and fixes Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2017-03-16 16:09 Arnaldo Carvalho de Melo
2017-03-16 16:30 ` Ingo Molnar
2015-08-31 21:36 Arnaldo Carvalho de Melo
2015-09-01  8:26 ` Ingo Molnar
2015-06-03 22:40 Arnaldo Carvalho de Melo
2015-06-04  5:48 ` Ingo Molnar
2015-06-04  6:07   ` Wangnan (F)
2015-06-04  7:21     ` Ingo Molnar
2015-06-04 10:00       ` Wangnan (F)
2015-06-04 12:40         ` Ingo Molnar
2015-06-04 12:58           ` pi3orama
2015-06-04 14:04             ` Ingo Molnar
2015-06-04 16:22               ` Alexei Starovoitov
2015-06-04 21:48                 ` Masami Hiramatsu
2015-06-04 22:07                   ` Alexei Starovoitov
2015-06-05  6:41                 ` Ingo Molnar
2015-06-05  8:53                   ` Wangnan (F)
2015-06-05 12:05                     ` Ingo Molnar
2015-06-05 14:06                       ` Arnaldo Carvalho de Melo
2015-06-07 13:11                         ` Ingo Molnar
2015-06-05 13:59                     ` Arnaldo Carvalho de Melo
2015-03-31 20:59 Arnaldo Carvalho de Melo
2015-04-01  7:56 ` Ingo Molnar
2015-03-26 15:40 Arnaldo Carvalho de Melo
2015-03-27  7:37 ` Ingo Molnar
2014-05-12  9:27 Jiri Olsa
2014-05-12 15:59 ` Ingo Molnar
2014-04-30 10:11 Jiri Olsa
2014-05-01  6:26 ` Ingo Molnar
2012-10-31 14:48 Arnaldo Carvalho de Melo
2011-02-16 22:54 Arnaldo Carvalho de Melo
2011-02-17 13:50 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®