Hide caller unless custom -e is passed
diff --git a/options.c b/options.c
index 193b650..1580010 100644
--- a/options.c
+++ b/options.c
@@ -639,8 +639,10 @@
/* Set default filter. Use @MAIN for now, as that's what
* ltrace used to have in the past. XXX Maybe we should make
* this "*" instead. */
- if (options.filter == NULL)
+ if (options.filter == NULL) {
parse_filter_chain(&options, "@MAIN");
+ options.hide_caller = 1;
+ }
if (!opt_p && argc < 1) {
fprintf(stderr, "%s: too few arguments\n", progname);
diff --git a/options.h b/options.h
index 2a10ddf..9cd0bfc 100644
--- a/options.h
+++ b/options.h
@@ -22,6 +22,7 @@
int bt_depth; /* how may levels of stack frames to show */
#endif /* defined(HAVE_LIBUNWIND) */
struct filter *filter;
+ int hide_caller; /* Whether caller library should be hidden. */
};
extern struct options_t options;
diff --git a/output.c b/output.c
index 0f59e2e..bc4b681 100644
--- a/output.c
+++ b/output.c
@@ -174,14 +174,15 @@
current_proc = proc;
current_depth = proc->callstack_depth;
begin_of_line(type, proc);
+ if (!options.hide_caller)
+ fprintf(options.output, "%s->", libsym->lib->soname);
#ifdef USE_DEMANGLE
current_column +=
- fprintf(options.output, "%s->%s(", libsym->lib->soname,
+ fprintf(options.output, "%s(",
(options.demangle
? my_demangle(function_name) : function_name));
#else
- current_column += fprintf(options.output, "%s->%s(",
- libsym->lib->name, function_name);
+ current_column += fprintf("%s(", function_name);
#endif
func = name2func(function_name);