From 73b30c1c89899bdb9d034af51108057c7539cbcf Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 18 Jul 2024 14:23:43 +0200 Subject: [PATCH] ras-events: drop a dead code to check number of CPUs Just use sysconf(_SC_NPROCESSORS_ONLN) here. Signed-off-by: Mauro Carvalho Chehab --- ras-events.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/ras-events.c b/ras-events.c index 2905644..53e15de 100644 --- a/ras-events.c +++ b/ras-events.c @@ -387,26 +387,6 @@ static void parse_ras_data(struct pthread_data *pdata, struct kbuffer *kbuf, static int get_num_cpus(struct ras_events *ras) { return sysconf(_SC_NPROCESSORS_ONLN); -#if 0 - char fname[MAX_PATH + 1]; - int num_cpus = 0; - DIR *dir; - struct dirent *entry; - - strcpy(fname, ras->debugfs); - strcat(fname, "/tracing/per_cpu/"); - dir = opendir(fname); - if (!dir) - return -1; - - for (entry = readdir(dir); entry; entry = readdir(dir)) { - if (strstr(entry->d_name, "cpu")) - num_cpus++; - } - closedir(dir); - - return num_cpus; -#endif } static int set_buffer_percent(struct ras_events *ras, int percent) -- 2.49.0