aboutsummaryrefslogtreecommitdiff
path: root/gprof/utils.c
diff options
context:
space:
mode:
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);
}