@@ -1984,6 +1984,7 @@ void help(void)
1984
1984
" -c, --cpu cpu-set limit output to summary plus cpu-set:\n"
1985
1985
" {core | package | j,k,l..m,n-p }\n"
1986
1986
" -d, --debug displays usec, Time_Of_Day_Seconds and more debugging\n"
1987
+ " debug messages are printed to stderr\n"
1987
1988
" -D, --Dump displays the raw counter values\n"
1988
1989
" -e, --enable [all | column]\n"
1989
1990
" shows all or the specified disabled column\n"
@@ -8262,7 +8263,7 @@ int added_perf_counters_init_(struct perf_counter_info *pinfo)
8262
8263
pinfo -> scale = perf_scale ;
8263
8264
8264
8265
if (debug )
8265
- printf ( "Add perf/%s/%s cpu%d: %d\n" ,
8266
+ fprintf ( stderr , "Add perf/%s/%s cpu%d: %d\n" ,
8266
8267
pinfo -> device , pinfo -> event , cpu , pinfo -> fd_perf_per_domain [next_domain ]);
8267
8268
}
8268
8269
@@ -8422,7 +8423,7 @@ struct msr_counter *find_msrp_by_name(struct msr_counter *head, char *name)
8422
8423
8423
8424
for (mp = head ; mp ; mp = mp -> next ) {
8424
8425
if (debug )
8425
- printf ( "%s: %s %s\n" , __func__ , name , mp -> name );
8426
+ fprintf ( stderr , "%s: %s %s\n" , __func__ , name , mp -> name );
8426
8427
if (!strncmp (name , mp -> name , strlen (mp -> name )))
8427
8428
return mp ;
8428
8429
}
@@ -8439,16 +8440,16 @@ int add_counter(unsigned int msr_num, char *path, char *name,
8439
8440
errx (1 , "Requested MSR counter 0x%x, but in --no-msr mode" , msr_num );
8440
8441
8441
8442
if (debug )
8442
- printf ( "%s(msr%d, %s, %s, width%d, scope%d, type%d, format%d, flags%x, id%d)\n" , __func__ , msr_num ,
8443
- path , name , width , scope , type , format , flags , id );
8443
+ fprintf ( stderr , "%s(msr%d, %s, %s, width%d, scope%d, type%d, format%d, flags%x, id%d)\n" ,
8444
+ __func__ , msr_num , path , name , width , scope , type , format , flags , id );
8444
8445
8445
8446
switch (scope ) {
8446
8447
8447
8448
case SCOPE_CPU :
8448
8449
msrp = find_msrp_by_name (sys .tp , name );
8449
8450
if (msrp ) {
8450
8451
if (debug )
8451
- printf ( "%s: %s FOUND\n" , __func__ , name );
8452
+ fprintf ( stderr , "%s: %s FOUND\n" , __func__ , name );
8452
8453
break ;
8453
8454
}
8454
8455
if (sys .added_thread_counters ++ >= MAX_ADDED_THREAD_COUNTERS ) {
@@ -8460,7 +8461,7 @@ int add_counter(unsigned int msr_num, char *path, char *name,
8460
8461
msrp = find_msrp_by_name (sys .cp , name );
8461
8462
if (msrp ) {
8462
8463
if (debug )
8463
- printf ( "%s: %s FOUND\n" , __func__ , name );
8464
+ fprintf ( stderr , "%s: %s FOUND\n" , __func__ , name );
8464
8465
break ;
8465
8466
}
8466
8467
if (sys .added_core_counters ++ >= MAX_ADDED_CORE_COUNTERS ) {
@@ -8472,7 +8473,7 @@ int add_counter(unsigned int msr_num, char *path, char *name,
8472
8473
msrp = find_msrp_by_name (sys .pp , name );
8473
8474
if (msrp ) {
8474
8475
if (debug )
8475
- printf ( "%s: %s FOUND\n" , __func__ , name );
8476
+ fprintf ( stderr , "%s: %s FOUND\n" , __func__ , name );
8476
8477
break ;
8477
8478
}
8478
8479
if (sys .added_package_counters ++ >= MAX_ADDED_PACKAGE_COUNTERS ) {
@@ -8617,7 +8618,7 @@ int add_perf_counter(const char *perf_device, const char *perf_event, const char
8617
8618
8618
8619
// FIXME: we might not have debug here yet
8619
8620
if (debug )
8620
- printf ( "%s: %s/%s, name: %s, scope%d\n" ,
8621
+ fprintf ( stderr , "%s: %s/%s, name: %s, scope%d\n" ,
8621
8622
__func__ , pinfo -> device , pinfo -> event , pinfo -> name , pinfo -> scope );
8622
8623
8623
8624
return 0 ;
0 commit comments