From: Philippe E. <ph...@us...> - 2003-01-18 21:09:03
|
Update of /cvsroot/oprofile/oprofile/daemon In directory sc8-pr-cvs1:/tmp/cvs-serv13185/daemon Modified Files: opd_image.c opd_kernel.c Log Message: 64 bits printf/scanf safety regards, Phil Index: opd_image.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/daemon/opd_image.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- opd_image.c 11 Jan 2003 08:15:43 -0000 1.25 +++ opd_image.c 18 Jan 2003 21:09:00 -0000 1.26 @@ -144,7 +144,7 @@ /* FIXME: if dcookie lookup fail we will re open multiple time the * same db which doesn't work */ if (lookup_dcookie(cookie, buf, PATH_MAX) <= 0) { - fprintf(stderr, "Lookup of cookie %Lx failed, errno=%d\n", + fprintf(stderr, "Lookup of cookie %llx failed, errno=%d\n", cookie, errno); exit(EXIT_FAILURE); } @@ -152,7 +152,7 @@ image->name = xstrdup(buf); if (lookup_dcookie(app_cookie, buf, PATH_MAX) <= 0) { - fprintf(stderr, "Lookup of cookie %Lx failed, errno=%d\n", + fprintf(stderr, "Lookup of cookie %llx failed, errno=%d\n", cookie, errno); exit(EXIT_FAILURE); } @@ -364,12 +364,12 @@ unsigned long event = get_buffer_value(buffer, index + 1); if (opd_eip_is_kernel(eip)) { - verbprintf("Kernel sample 0x%Lx, counter %Lu\n", - (u_int64_t)eip, (u_int64_t)event); + verbprintf("Kernel sample 0x%llx, counter %lu\n", + eip, event); opd_handle_kernel_sample(eip, event); } else { - verbprintf("Image (%s) offset 0x%Lx, counter %Lu\n", - image->name, (u_int64_t)eip, (u_int64_t)event); + verbprintf("Image (%s) offset 0x%llx, counter %lu\n", + image->name, eip, event); opd_put_image_sample(image, eip, event); } } @@ -414,7 +414,7 @@ case COOKIE_SWITCH_CODE: cookie = get_buffer_value(buffer, i); image = opd_get_image(cookie, app_cookie); - verbprintf("COOKIE_SWITCH to cookie %Lx (%s)\n", cookie, image->name); + verbprintf("COOKIE_SWITCH to cookie %llx (%s)\n", cookie, image->name); ++i; break; Index: opd_kernel.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/daemon/opd_kernel.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- opd_kernel.c 10 Jan 2003 22:15:49 -0000 1.8 +++ opd_kernel.c 18 Jan 2003 21:09:00 -0000 1.9 @@ -56,14 +56,14 @@ */ void opd_parse_kernel_range(char const * arg) { - sscanf(arg, "%Lx,%Lx", &kernel_start, &kernel_end); + sscanf(arg, "%llx,%llx", &kernel_start, &kernel_end); - verbprintf("OPD_PARSE_KERNEL_RANGE: kernel_start = %Lx, kernel_end = %Lx\n", + verbprintf("OPD_PARSE_KERNEL_RANGE: kernel_start = %llx, kernel_end = %llx\n", kernel_start, kernel_end); if (kernel_start == 0x0 || kernel_end == 0x0) { fprintf(stderr, - "Warning: mis-parsed kernel range: %Lx-%Lx\n", + "Warning: mis-parsed kernel range: %llx-%llx\n", kernel_start, kernel_end); fprintf(stderr, "kernel profiles will be wrong.\n"); } @@ -239,8 +239,8 @@ } cp2 += 7; - sscanf(line,"%Lx", &mod->start); - sscanf(cp2,"%Lu", &mod->end); + sscanf(line,"%llx", &mod->start); + sscanf(cp2,"%llu", &mod->end); mod->end += mod->start; break; } |