@@ -239,8 +239,8 @@ static void clear_probe_trace_events(struct probe_trace_event *tevs, int ntevs)
239
239
clear_probe_trace_event (tevs + i );
240
240
}
241
241
242
- static bool kprobe_blacklist__listed (unsigned long address );
243
- static bool kprobe_warn_out_range (const char * symbol , unsigned long address )
242
+ static bool kprobe_blacklist__listed (u64 address );
243
+ static bool kprobe_warn_out_range (const char * symbol , u64 address )
244
244
{
245
245
struct map * map ;
246
246
bool ret = false;
@@ -400,8 +400,7 @@ static int find_alternative_probe_point(struct debuginfo *dinfo,
400
400
pr_debug ("Symbol %s address found : %" PRIx64 "\n" ,
401
401
pp -> function , address );
402
402
403
- ret = debuginfo__find_probe_point (dinfo , (unsigned long )address ,
404
- result );
403
+ ret = debuginfo__find_probe_point (dinfo , address , result );
405
404
if (ret <= 0 )
406
405
ret = (!ret ) ? - ENOENT : ret ;
407
406
else {
@@ -589,7 +588,7 @@ static void debuginfo_cache__exit(void)
589
588
}
590
589
591
590
592
- static int get_text_start_address (const char * exec , unsigned long * address ,
591
+ static int get_text_start_address (const char * exec , u64 * address ,
593
592
struct nsinfo * nsi )
594
593
{
595
594
Elf * elf ;
@@ -634,7 +633,7 @@ static int find_perf_probe_point_from_dwarf(struct probe_trace_point *tp,
634
633
bool is_kprobe )
635
634
{
636
635
struct debuginfo * dinfo = NULL ;
637
- unsigned long stext = 0 ;
636
+ u64 stext = 0 ;
638
637
u64 addr = tp -> address ;
639
638
int ret = - ENOENT ;
640
639
@@ -662,8 +661,7 @@ static int find_perf_probe_point_from_dwarf(struct probe_trace_point *tp,
662
661
663
662
dinfo = debuginfo_cache__open (tp -> module , verbose <= 0 );
664
663
if (dinfo )
665
- ret = debuginfo__find_probe_point (dinfo ,
666
- (unsigned long )addr , pp );
664
+ ret = debuginfo__find_probe_point (dinfo , addr , pp );
667
665
else
668
666
ret = - ENOENT ;
669
667
@@ -678,7 +676,7 @@ static int find_perf_probe_point_from_dwarf(struct probe_trace_point *tp,
678
676
679
677
/* Adjust symbol name and address */
680
678
static int post_process_probe_trace_point (struct probe_trace_point * tp ,
681
- struct map * map , unsigned long offs )
679
+ struct map * map , u64 offs )
682
680
{
683
681
struct symbol * sym ;
684
682
u64 addr = tp -> address - offs ;
@@ -721,7 +719,7 @@ post_process_offline_probe_trace_events(struct probe_trace_event *tevs,
721
719
int ntevs , const char * pathname )
722
720
{
723
721
struct map * map ;
724
- unsigned long stext = 0 ;
722
+ u64 stext = 0 ;
725
723
int i , ret = 0 ;
726
724
727
725
/* Prepare a map for offline binary */
@@ -747,7 +745,7 @@ static int add_exec_to_probe_trace_events(struct probe_trace_event *tevs,
747
745
struct nsinfo * nsi )
748
746
{
749
747
int i , ret = 0 ;
750
- unsigned long stext = 0 ;
748
+ u64 stext = 0 ;
751
749
752
750
if (!exec )
753
751
return 0 ;
@@ -792,7 +790,7 @@ post_process_module_probe_trace_events(struct probe_trace_event *tevs,
792
790
mod_name = find_module_name (module );
793
791
for (i = 0 ; i < ntevs ; i ++ ) {
794
792
ret = post_process_probe_trace_point (& tevs [i ].point ,
795
- map , ( unsigned long ) text_offs );
793
+ map , text_offs );
796
794
if (ret < 0 )
797
795
break ;
798
796
tevs [i ].point .module =
@@ -1536,7 +1534,7 @@ static int parse_perf_probe_point(char *arg, struct perf_probe_event *pev)
1536
1534
* so tmp[1] should always valid (but could be '\0').
1537
1535
*/
1538
1536
if (tmp && !strncmp (tmp , "0x" , 2 )) {
1539
- pp -> abs_address = strtoul (pp -> function , & tmp , 0 );
1537
+ pp -> abs_address = strtoull (pp -> function , & tmp , 0 );
1540
1538
if (* tmp != '\0' ) {
1541
1539
semantic_error ("Invalid absolute address.\n" );
1542
1540
return - EINVAL ;
@@ -1911,7 +1909,7 @@ int parse_probe_trace_command(const char *cmd, struct probe_trace_event *tev)
1911
1909
argv [i ] = NULL ;
1912
1910
argc -= 1 ;
1913
1911
} else
1914
- tp -> address = strtoul (fmt1_str , NULL , 0 );
1912
+ tp -> address = strtoull (fmt1_str , NULL , 0 );
1915
1913
} else {
1916
1914
/* Only the symbol-based probe has offset */
1917
1915
tp -> symbol = strdup (fmt1_str );
@@ -2157,7 +2155,7 @@ synthesize_uprobe_trace_def(struct probe_trace_point *tp, struct strbuf *buf)
2157
2155
return - EINVAL ;
2158
2156
2159
2157
/* Use the tp->address for uprobes */
2160
- err = strbuf_addf (buf , "%s:0x%lx" , tp -> module , tp -> address );
2158
+ err = strbuf_addf (buf , "%s:0x%" PRIx64 , tp -> module , tp -> address );
2161
2159
2162
2160
if (err >= 0 && tp -> ref_ctr_offset ) {
2163
2161
if (!uprobe_ref_ctr_is_supported ())
@@ -2172,7 +2170,7 @@ synthesize_kprobe_trace_def(struct probe_trace_point *tp, struct strbuf *buf)
2172
2170
{
2173
2171
if (!strncmp (tp -> symbol , "0x" , 2 )) {
2174
2172
/* Absolute address. See try_to_find_absolute_address() */
2175
- return strbuf_addf (buf , "%s%s0x%lx" , tp -> module ?: "" ,
2173
+ return strbuf_addf (buf , "%s%s0x%" PRIx64 , tp -> module ?: "" ,
2176
2174
tp -> module ? ":" : "" , tp -> address );
2177
2175
} else {
2178
2176
return strbuf_addf (buf , "%s%s%s+%lu" , tp -> module ?: "" ,
@@ -2271,7 +2269,7 @@ static int convert_to_perf_probe_point(struct probe_trace_point *tp,
2271
2269
pp -> function = strdup (tp -> symbol );
2272
2270
pp -> offset = tp -> offset ;
2273
2271
} else {
2274
- ret = e_snprintf (buf , 128 , "0x%" PRIx64 , ( u64 ) tp -> address );
2272
+ ret = e_snprintf (buf , 128 , "0x%" PRIx64 , tp -> address );
2275
2273
if (ret < 0 )
2276
2274
return ret ;
2277
2275
pp -> function = strdup (buf );
@@ -2452,8 +2450,8 @@ void clear_probe_trace_event(struct probe_trace_event *tev)
2452
2450
2453
2451
struct kprobe_blacklist_node {
2454
2452
struct list_head list ;
2455
- unsigned long start ;
2456
- unsigned long end ;
2453
+ u64 start ;
2454
+ u64 end ;
2457
2455
char * symbol ;
2458
2456
};
2459
2457
@@ -2498,7 +2496,7 @@ static int kprobe_blacklist__load(struct list_head *blacklist)
2498
2496
}
2499
2497
INIT_LIST_HEAD (& node -> list );
2500
2498
list_add_tail (& node -> list , blacklist );
2501
- if (sscanf (buf , "0x%lx -0x%lx" , & node -> start , & node -> end ) != 2 ) {
2499
+ if (sscanf (buf , "0x%" PRIx64 " -0x%" PRIx64 , & node -> start , & node -> end ) != 2 ) {
2502
2500
ret = - EINVAL ;
2503
2501
break ;
2504
2502
}
@@ -2514,7 +2512,7 @@ static int kprobe_blacklist__load(struct list_head *blacklist)
2514
2512
ret = - ENOMEM ;
2515
2513
break ;
2516
2514
}
2517
- pr_debug2 ("Blacklist: 0x%lx -0x%lx , %s\n" ,
2515
+ pr_debug2 ("Blacklist: 0x%" PRIx64 " -0x%" PRIx64 " , %s\n" ,
2518
2516
node -> start , node -> end , node -> symbol );
2519
2517
ret ++ ;
2520
2518
}
@@ -2526,8 +2524,7 @@ static int kprobe_blacklist__load(struct list_head *blacklist)
2526
2524
}
2527
2525
2528
2526
static struct kprobe_blacklist_node *
2529
- kprobe_blacklist__find_by_address (struct list_head * blacklist ,
2530
- unsigned long address )
2527
+ kprobe_blacklist__find_by_address (struct list_head * blacklist , u64 address )
2531
2528
{
2532
2529
struct kprobe_blacklist_node * node ;
2533
2530
@@ -2555,7 +2552,7 @@ static void kprobe_blacklist__release(void)
2555
2552
kprobe_blacklist__delete (& kprobe_blacklist );
2556
2553
}
2557
2554
2558
- static bool kprobe_blacklist__listed (unsigned long address )
2555
+ static bool kprobe_blacklist__listed (u64 address )
2559
2556
{
2560
2557
return !!kprobe_blacklist__find_by_address (& kprobe_blacklist , address );
2561
2558
}
@@ -3223,7 +3220,7 @@ static int try_to_find_absolute_address(struct perf_probe_event *pev,
3223
3220
* In __add_probe_trace_events, a NULL symbol is interpreted as
3224
3221
* invalid.
3225
3222
*/
3226
- if (asprintf (& tp -> symbol , "0x%lx" , tp -> address ) < 0 )
3223
+ if (asprintf (& tp -> symbol , "0x%" PRIx64 , tp -> address ) < 0 )
3227
3224
goto errout ;
3228
3225
3229
3226
/* For kprobe, check range */
@@ -3234,7 +3231,7 @@ static int try_to_find_absolute_address(struct perf_probe_event *pev,
3234
3231
goto errout ;
3235
3232
}
3236
3233
3237
- if (asprintf (& tp -> realname , "abs_%lx" , tp -> address ) < 0 )
3234
+ if (asprintf (& tp -> realname , "abs_%" PRIx64 , tp -> address ) < 0 )
3238
3235
goto errout ;
3239
3236
3240
3237
if (pev -> target ) {
0 commit comments