@@ -987,57 +987,6 @@ static int write_dir_format(struct feat_fd *ff,
987
987
return do_write (ff , & data -> dir .version , sizeof (data -> dir .version ));
988
988
}
989
989
990
- /*
991
- * Check whether a CPU is online
992
- *
993
- * Returns:
994
- * 1 -> if CPU is online
995
- * 0 -> if CPU is offline
996
- * -1 -> error case
997
- */
998
- int is_cpu_online (unsigned int cpu )
999
- {
1000
- char * str ;
1001
- size_t strlen ;
1002
- char buf [256 ];
1003
- int status = -1 ;
1004
- struct stat statbuf ;
1005
-
1006
- snprintf (buf , sizeof (buf ),
1007
- "/sys/devices/system/cpu/cpu%d" , cpu );
1008
- if (stat (buf , & statbuf ) != 0 )
1009
- return 0 ;
1010
-
1011
- /*
1012
- * Check if /sys/devices/system/cpu/cpux/online file
1013
- * exists. Some cases cpu0 won't have online file since
1014
- * it is not expected to be turned off generally.
1015
- * In kernels without CONFIG_HOTPLUG_CPU, this
1016
- * file won't exist
1017
- */
1018
- snprintf (buf , sizeof (buf ),
1019
- "/sys/devices/system/cpu/cpu%d/online" , cpu );
1020
- if (stat (buf , & statbuf ) != 0 )
1021
- return 1 ;
1022
-
1023
- /*
1024
- * Read online file using sysfs__read_str.
1025
- * If read or open fails, return -1.
1026
- * If read succeeds, return value from file
1027
- * which gets stored in "str"
1028
- */
1029
- snprintf (buf , sizeof (buf ),
1030
- "devices/system/cpu/cpu%d/online" , cpu );
1031
-
1032
- if (sysfs__read_str (buf , & str , & strlen ) < 0 )
1033
- return status ;
1034
-
1035
- status = atoi (str );
1036
-
1037
- free (str );
1038
- return status ;
1039
- }
1040
-
1041
990
#ifdef HAVE_LIBBPF_SUPPORT
1042
991
static int write_bpf_prog_info (struct feat_fd * ff ,
1043
992
struct evlist * evlist __maybe_unused )
0 commit comments