summaryrefslogtreecommitdiff
path: root/tools/perf/util
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/session.c50
-rw-r--r--tools/perf/util/session.h5
2 files changed, 32 insertions, 23 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index f5a8fbdd3f7..ad33650cdd4 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1202,9 +1202,10 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,
return NULL;
}
-void perf_session__print_symbols(union perf_event *event,
- struct perf_sample *sample,
- struct perf_session *session)
+void perf_session__print_ip(union perf_event *event,
+ struct perf_sample *sample,
+ struct perf_session *session,
+ int print_sym)
{
struct addr_location al;
const char *symname, *dsoname;
@@ -1233,32 +1234,39 @@ void perf_session__print_symbols(union perf_event *event,
if (!node)
break;
- if (node->sym && node->sym->name)
- symname = node->sym->name;
- else
- symname = "";
+ printf("\t%16" PRIx64, node->ip);
+ if (print_sym) {
+ if (node->sym && node->sym->name)
+ symname = node->sym->name;
+ else
+ symname = "";
- if (node->map && node->map->dso && node->map->dso->name)
- dsoname = node->map->dso->name;
- else
- dsoname = "";
+ if (node->map && node->map->dso && node->map->dso->name)
+ dsoname = node->map->dso->name;
+ else
+ dsoname = "";
- printf("\t%16" PRIx64 " %s (%s)\n", node->ip, symname, dsoname);
+ printf(" %s (%s)", symname, dsoname);
+ }
+ printf("\n");
callchain_cursor_advance(cursor);
}
} else {
- if (al.sym && al.sym->name)
- symname = al.sym->name;
- else
- symname = "";
+ printf("%16" PRIx64, al.addr);
+ if (print_sym) {
+ if (al.sym && al.sym->name)
+ symname = al.sym->name;
+ else
+ symname = "";
- if (al.map && al.map->dso && al.map->dso->name)
- dsoname = al.map->dso->name;
- else
- dsoname = "";
+ if (al.map && al.map->dso && al.map->dso->name)
+ dsoname = al.map->dso->name;
+ else
+ dsoname = "";
- printf("%16" PRIx64 " %s (%s)", al.addr, symname, dsoname);
+ printf(" %s (%s)", symname, dsoname);
+ }
}
}
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index 66d4e149087..d76af0f975d 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -167,8 +167,9 @@ static inline int perf_session__parse_sample(struct perf_session *session,
struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,
unsigned int type);
-void perf_session__print_symbols(union perf_event *event,
+void perf_session__print_ip(union perf_event *event,
struct perf_sample *sample,
- struct perf_session *session);
+ struct perf_session *session,
+ int print_sym);
#endif /* __PERF_SESSION_H */