Lines Matching refs:path

63 	char path[PATH_BYTES];
1914 FILE *fopen_or_die(const char *path, const char *mode)
1916 FILE *filep = fopen(path, mode);
1919 err(1, "%s: open failed", path);
1928 unsigned long long snapshot_sysfs_counter(char *path)
1934 fp = fopen_or_die(path, "r");
1938 err(1, "snapshot_sysfs_counter(%s)", path);
1951 char path[128 + PATH_BYTES];
1954 sprintf(path, "/sys/devices/system/cpu/cpu%d/%s", cpu, mp->path);
1956 *counterp = snapshot_sysfs_counter(path);
1958 *counterp = snapshot_sysfs_counter(mp->path);
1967 char path[128];
1969 sprintf(path, "/sys/devices/system/cpu/intel_uncore_frequency/package_0%d_die_0%d/current_freq_khz", package,
1972 return (snapshot_sysfs_counter(path) / 1000);
1977 char path[128 + PATH_BYTES];
1982 sprintf(path, "/sys/devices/system/cpu/cpu%d/power/energy_perf_bias", cpu);
1984 fp = fopen(path, "r");
1990 err(1, "%s(%s)", __func__, path);
2052 char path[128 + PATH_BYTES];
2057 sprintf(path, "/sys/devices/system/cpu/cpu%d/thermal_throttle/core_throttle_count", cpu);
2058 fp = fopen(path, "r");
2832 char path[PATH_MAX];
2837 vsnprintf(path, sizeof(path), fmt, args);
2839 filep = fopen(path, "r");
2843 err(1, "%s: failed to parse number from file", path);
2914 char path[80];
2920 sprintf(path, "/sys/devices/system/cpu/cpu%d/node%i/cpulist", cpu, i);
2921 filep = fopen(path, "r");
2932 char path[80], character;
2950 sprintf(path, "/sys/devices/system/cpu/cpu%d/topology/thread_siblings", cpu);
2951 filep = fopen(path, "r");
2954 warnx("%s: open failed", path);
2960 err(1, "%s: failed to parse file", path);
4119 static int read_sysfs_int(char *path)
4124 input = fopen(path, "r");
4127 fprintf(outf, "NSFOD %s\n", path);
4131 err(1, "%s: failed to read int from file", path);
4137 static void dump_sysfs_file(char *path)
4142 input = fopen(path, "r");
4145 fprintf(outf, "NSFOD %s\n", path);
4149 err(1, "%s: failed to read file", path);
4152 fprintf(outf, "%s: %s", strrchr(path, '/') + 1, cpuidle_buf);
4158 char path[128];
4176 sprintf(path, "/sys/devices/system/cpu/intel_uncore_frequency/package_0%d_die_0%d/min_freq_khz",
4178 k = read_sysfs_int(path);
4179 sprintf(path, "/sys/devices/system/cpu/intel_uncore_frequency/package_0%d_die_0%d/max_freq_khz",
4181 l = read_sysfs_int(path);
4184 sprintf(path,
4187 k = read_sysfs_int(path);
4188 sprintf(path,
4191 l = read_sysfs_int(path);
4199 char path[64];
4217 sprintf(path, "/sys/devices/system/cpu/cpu%d/cpuidle/state%d/name", base_cpu, state);
4218 input = fopen(path, "r");
4222 err(1, "%s: failed to read file", path);
4233 sprintf(path, "/sys/devices/system/cpu/cpu%d/cpuidle/state%d/desc", base_cpu, state);
4234 input = fopen(path, "r");
4238 err(1, "%s: failed to read file", path);
4247 char path[64];
4253 sprintf(path, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_driver", base_cpu);
4254 input = fopen(path, "r");
4256 fprintf(outf, "NSFOD %s\n", path);
4260 err(1, "%s: failed to read file", path);
4263 sprintf(path, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor", base_cpu);
4264 input = fopen(path, "r");
4266 fprintf(outf, "NSFOD %s\n", path);
4270 err(1, "%s: failed to read file", path);
4276 sprintf(path, "/sys/devices/system/cpu/cpufreq/boost");
4277 input = fopen(path, "r");
4280 err(1, "%s: failed to parse number from file", path);
4285 sprintf(path, "/sys/devices/system/cpu/intel_pstate/no_turbo");
4286 input = fopen(path, "r");
4289 err(1, "%s: failed to parse number from file", path);
5472 char *path = "/dev/cpu_dma_latency";
5477 fd = open(path, O_RDONLY);
5485 warn("read failed %s", path);
6255 int add_counter(unsigned int msr_num, char *path, char *name,
6269 if (path)
6270 strncpy(msrp->path, path, PATH_BYTES - 1);
6315 char *path = NULL;
6332 path = add_command;
6395 if ((msr_num == 0) && (path == NULL)) {
6408 if (add_counter(msr_num, path, name_buffer, width, scope, type, format, 0))
6439 char path[64];
6447 sprintf(path, "/sys/devices/system/cpu/cpu%d/cpuidle/state%d/name", base_cpu, state);
6448 input = fopen(path, "r");
6452 err(1, "%s: failed to read file", path);
6465 sprintf(path, "cpuidle/state%d/time", state);
6473 add_counter(0, path, name_buf, 64, SCOPE_CPU, COUNTER_USEC, FORMAT_PERCENT, SYSFS_PERCPU);
6478 sprintf(path, "/sys/devices/system/cpu/cpu%d/cpuidle/state%d/name", base_cpu, state);
6479 input = fopen(path, "r");
6483 err(1, "%s: failed to read file", path);
6493 sprintf(path, "cpuidle/state%d/usage", state);
6501 add_counter(0, path, name_buf, 64, SCOPE_CPU, COUNTER_ITEMS, FORMAT_DELTA, SYSFS_PERCPU);