aboutsummaryrefslogtreecommitdiff
path: root/gprof/utils.c
diff options
context:
space:
mode:
authorConrad Hoffmann <ch@bitfehler.net>2013-11-21 13:13:06 +0000
committerNick Clifton <nickc@redhat.com>2013-11-21 13:13:06 +0000
commit630b051036e446754f13d1f07cfd6de0612a90de (patch)
treeea54ec9363d151c752d57a703f18c2d75a2634b4 /gprof/utils.c
parent97122a4cffdf7d9adfdef451498e92d4e46b5783 (diff)
downloadgdb-630b051036e446754f13d1f07cfd6de0612a90de.zip
gdb-630b051036e446754f13d1f07cfd6de0612a90de.tar.gz
gdb-630b051036e446754f13d1f07cfd6de0612a90de.tar.bz2
* gprof.c (inline_file_names): New variable.
(OPTION_INLINE_FILE_NAMES): Define. (long_options): Add --inline-file-names. (usage): Likewise. (main): Process --inline-file-names. * gprof.h: Add prototype for inline_file_names. * utils.c (print_name_only): Handle inline_file_names. * gprof.texi: Document new command line option.
Diffstat (limited to 'gprof/utils.c')
-rw-r--r--gprof/utils.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gprof/utils.c b/gprof/utils.c
index f349841..4fc2db6 100644
--- a/gprof/utils.c
+++ b/gprof/utils.c
@@ -58,7 +58,7 @@ print_name_only (Sym *self)
}
printf ("%s", name);
size = strlen (name);
- if (line_granularity && self->file)
+ if ((line_granularity || inline_file_names) && self->file)
{
filename = self->file->name;
if (!print_path)
@@ -73,8 +73,15 @@ print_name_only (Sym *self)
filename = self->file->name;
}
}
- sprintf (buf, " (%s:%d @ %lx)", filename, self->line_num,
- (unsigned long) self->addr);
+ if (line_granularity)
+ {
+ sprintf (buf, " (%s:%d @ %lx)", filename, self->line_num,
+ (unsigned long) self->addr);
+ }
+ else
+ {
+ sprintf (buf, " (%s:%d)", filename, self->line_num);
+ }
printf ("%s", buf);
size += strlen (buf);
}