summaryrefslogtreecommitdiffstats
path: root/sys-utils/readprofile.c
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:41 +0100
committerKarel Zak2006-12-07 00:25:41 +0100
commiteb63b9b8f4cecb34c2478282567862bc48ef256d (patch)
tree99243f8eecb44c2bb6a559982b99c680fcb649e7 /sys-utils/readprofile.c
parentImported from util-linux-2.9v tarball. (diff)
downloadkernel-qcow2-util-linux-eb63b9b8f4cecb34c2478282567862bc48ef256d.tar.gz
kernel-qcow2-util-linux-eb63b9b8f4cecb34c2478282567862bc48ef256d.tar.xz
kernel-qcow2-util-linux-eb63b9b8f4cecb34c2478282567862bc48ef256d.zip
Imported from util-linux-2.10f tarball.
Diffstat (limited to 'sys-utils/readprofile.c')
-rw-r--r--sys-utils/readprofile.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sys-utils/readprofile.c b/sys-utils/readprofile.c
index ba982f7c3..6a8d4d20f 100644
--- a/sys-utils/readprofile.c
+++ b/sys-utils/readprofile.c
@@ -21,6 +21,8 @@
/*
* 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@misiek.eu.org>
* - added Native Language Support
+ * 1999-09-01 Stephane Eranian <eranian@cello.hpl.hp.com>
+ * - 64bit clean patch
*/
#include <errno.h>
@@ -79,9 +81,10 @@ FILE *pro;
FILE *map;
int proFd;
char *mapFile, *proFile;
-unsigned int len=0, add0=0, step, index=0;
+unsigned long len=0, add0=0, index=0;
+unsigned int step;
unsigned int *buf, total, fn_len;
-unsigned int fn_add, next_add; /* current and next address */
+unsigned long fn_add, next_add; /* current and next address */
char fn_name[S_LEN], next_name[S_LEN]; /* current and next name */
char mode[8];
int c;
@@ -162,13 +165,13 @@ int popenMap; /* flag to tell if popen() has been used */
while(fgets(mapline,S_LEN,map))
{
- if (sscanf(mapline,"%x %s %s",&fn_add,mode,fn_name)!=3)
+ if (sscanf(mapline,"%lx %s %s",&fn_add,mode,fn_name)!=3)
{
fprintf(stderr,_("%s: %s(%i): wrong map line\n"),
prgname,mapFile, maplineno);
exit(1);
}
- if (strcmp(fn_name,"_stext")) /* only elf works like this */
+ if (!strcmp(fn_name,"_stext")) /* only elf works like this */
{
add0=fn_add;
break;
@@ -188,12 +191,14 @@ int popenMap; /* flag to tell if popen() has been used */
{
unsigned int this=0;
- if (sscanf(mapline,"%x %s %s",&next_add,mode,next_name)!=3)
+ if (sscanf(mapline,"%lx %s %s",&next_add,mode,next_name)!=3)
{
fprintf(stderr,_("%s: %s(%i): wrong map line\n"),
prgname,mapFile, maplineno);
exit(1);
}
+ /* ignore any LEADING (before a '[tT]' symbol is found) Absolute symbols */
+ if (*mode == 'A' && total == 0) continue;
if (*mode!='T' && *mode!='t') break; /* only text is profiled */
while (index < (next_add-add0)/step)
@@ -204,7 +209,7 @@ int popenMap; /* flag to tell if popen() has been used */
if (fn_len && (this || optAll))
{
if (optVerbose)
- printf("%08x %-40s %6i %8.4f\n",
+ printf("%08lx %-40s %6i %8.4f\n",
fn_add,fn_name,this,this/(double)fn_len);
else
printf("%6i %-40s %8.4f\n",