aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/event.c30
-rw-r--r--tools/perf/util/hist.c7
-rw-r--r--tools/perf/util/session.c4
-rw-r--r--tools/perf/util/session.h1
-rw-r--r--tools/perf/util/symbol.c1
-rw-r--r--tools/perf/util/symbol.h5
6 files changed, 39 insertions, 9 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index bf491fda1f4..bb0fd6da2d5 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -189,13 +189,41 @@ void event__synthesize_threads(int (*process)(event_t *event,
closedir(proc);
}
+static void thread__comm_adjust(struct thread *self)
+{
+ char *comm = self->comm;
+
+ if (!symbol_conf.col_width_list_str && !symbol_conf.field_sep &&
+ (!symbol_conf.comm_list ||
+ strlist__has_entry(symbol_conf.comm_list, comm))) {
+ unsigned int slen = strlen(comm);
+
+ if (slen > comms__col_width) {
+ comms__col_width = slen;
+ threads__col_width = slen + 6;
+ }
+ }
+}
+
+static int thread__set_comm_adjust(struct thread *self, const char *comm)
+{
+ int ret = thread__set_comm(self, comm);
+
+ if (ret)
+ return ret;
+
+ thread__comm_adjust(self);
+
+ return 0;
+}
+
int event__process_comm(event_t *self, struct perf_session *session)
{
struct thread *thread = perf_session__findnew(session, self->comm.pid);
dump_printf(": %s:%d\n", self->comm.comm, self->comm.pid);
- if (thread == NULL || thread__set_comm(thread, self->comm.comm)) {
+ if (thread == NULL || thread__set_comm_adjust(thread, self->comm.comm)) {
dump_printf("problem processing PERF_RECORD_COMM, skipping event.\n");
return -1;
}
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index b9828fce7bf..d9a5a19391d 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -156,8 +156,7 @@ void perf_session__collapse_resort(struct perf_session *self)
* reverse the map, sort on count.
*/
-static void perf_session__insert_output_hist_entry(struct perf_session *self,
- struct rb_root *root,
+static void perf_session__insert_output_hist_entry(struct rb_root *root,
struct hist_entry *he,
u64 min_callchain_hits)
{
@@ -165,7 +164,7 @@ static void perf_session__insert_output_hist_entry(struct perf_session *self,
struct rb_node *parent = NULL;
struct hist_entry *iter;
- if (self->use_callchain)
+ if (symbol_conf.use_callchain)
callchain_param.sort(&he->sorted_chain, &he->callchain,
min_callchain_hits, &callchain_param);
@@ -201,7 +200,7 @@ void perf_session__output_resort(struct perf_session *self, u64 total_samples)
next = rb_next(&n->rb_node);
rb_erase(&n->rb_node, &self->hists);
- perf_session__insert_output_hist_entry(self, &tmp, n,
+ perf_session__insert_output_hist_entry(&tmp, n,
min_callchain_hits);
}
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index bceaa09f55a..ce3a6c8abe7 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -108,7 +108,7 @@ struct symbol **perf_session__resolve_callchain(struct perf_session *self,
struct symbol **syms = NULL;
unsigned int i;
- if (self->use_callchain) {
+ if (symbol_conf.use_callchain) {
syms = calloc(chain->nr, sizeof(*syms));
if (!syms) {
fprintf(stderr, "Can't allocate memory for symbols\n");
@@ -140,7 +140,7 @@ struct symbol **perf_session__resolve_callchain(struct perf_session *self,
if (sort__has_parent && !*parent &&
symbol__match_parent_regex(al.sym))
*parent = al.sym;
- if (!self->use_callchain)
+ if (!symbol_conf.use_callchain)
break;
syms[i] = al.sym;
}
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index faf18a8e031..32eaa1bada0 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -25,7 +25,6 @@ struct perf_session {
int fd;
int cwdlen;
char *cwd;
- bool use_callchain;
char filename[0];
};
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 7707897b59f..ab92763edb0 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -38,6 +38,7 @@ static int vmlinux_path__nr_entries;
static char **vmlinux_path;
struct symbol_conf symbol_conf = {
+ .exclude_other = true,
.use_modules = true,
.try_vmlinux_path = true,
};
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 60151521f41..8aded2356f7 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -55,7 +55,10 @@ struct symbol_conf {
unsigned short priv_size;
bool try_vmlinux_path,
use_modules,
- sort_by_name;
+ sort_by_name,
+ show_nr_samples,
+ use_callchain,
+ exclude_other;
const char *vmlinux_name,
*field_sep;
char *dso_list_str,