* 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.
This commit is contained in:
Conrad Hoffmann 2013-11-21 13:13:06 +00:00 committed by Nick Clifton
parent 97122a4cff
commit 630b051036
5 changed files with 46 additions and 19 deletions

View file

@ -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);
}