Lines Matching defs:path

253 	char path[PATH_BYTES];
1787 FILE *fopen_or_die(const char *path, const char *mode)
1789 FILE *filep = fopen(path, mode);
1792 err(1, "%s: open failed", path);
1800 unsigned long long snapshot_sysfs_counter(char *path)
1806 fp = fopen_or_die(path, "r");
1810 err(1, "snapshot_sysfs_counter(%s)", path);
1823 char path[128 + PATH_BYTES];
1826 sprintf(path, "/sys/devices/system/cpu/cpu%d/%s",
1827 cpu, mp->path);
1829 *counterp = snapshot_sysfs_counter(path);
1831 *counterp = snapshot_sysfs_counter(mp->path);
2649 char path[PATH_MAX];
2654 vsnprintf(path, sizeof(path), fmt, args);
2656 filep = fopen(path, "r");
2660 err(1, "%s: failed to parse number from file", path);
2732 char path[80];
2738 sprintf(path, "/sys/devices/system/cpu/cpu%d/node%i/cpulist",
2740 filep = fopen(path, "r");
2751 char path[80], character;
2769 sprintf(path,
2771 filep = fopen(path, "r");
2774 warnx("%s: open failed", path);
2780 err(1, "%s: failed to parse file", path);
3798 static void dump_sysfs_file(char *path)
3803 input = fopen(path, "r");
3806 fprintf(outf, "NSFOD %s\n", path);
3810 err(1, "%s: failed to read file", path);
3813 fprintf(outf, "%s: %s", strrchr(path, '/') + 1, cpuidle_buf);
3818 char path[64];
3836 sprintf(path, "/sys/devices/system/cpu/cpu%d/cpuidle/state%d/name",
3838 input = fopen(path, "r");
3842 err(1, "%s: failed to read file", path);
3853 sprintf(path, "/sys/devices/system/cpu/cpu%d/cpuidle/state%d/desc",
3855 input = fopen(path, "r");
3859 err(1, "%s: failed to read file", path);
3868 char path[64];
3874 sprintf(path, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_driver",
3876 input = fopen(path, "r");
3878 fprintf(outf, "NSFOD %s\n", path);
3882 err(1, "%s: failed to read file", path);
3885 sprintf(path, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor",
3887 input = fopen(path, "r");
3889 fprintf(outf, "NSFOD %s\n", path);
3893 err(1, "%s: failed to read file", path);
3899 sprintf(path, "/sys/devices/system/cpu/cpufreq/boost");
3900 input = fopen(path, "r");
3903 err(1, "%s: failed to parse number from file", path);
3908 sprintf(path, "/sys/devices/system/cpu/intel_pstate/no_turbo");
3909 input = fopen(path, "r");
3912 err(1, "%s: failed to parse number from file", path);
4994 char *path = "/dev/cpu_dma_latency";
4999 fd = open(path, O_RDONLY);
5001 warn("fopen %s\n", path);
5007 warn("read failed %s\n", path);
5729 int add_counter(unsigned int msr_num, char *path, char *name,
5743 if (path)
5744 strncpy(msrp->path, path, PATH_BYTES - 1);
5792 char *path = NULL;
5809 path = add_command;
5872 if ((msr_num == 0) && (path == NULL)) {
5885 if (add_counter(msr_num, path, name_buffer, width, scope, type, format, 0))
5906 char path[64];
5917 sprintf(path, "/sys/devices/system/cpu/cpu%d/cpuidle/state%d/name",
5919 input = fopen(path, "r");
5923 err(1, "%s: failed to read file", path);
5936 sprintf(path, "cpuidle/state%d/time", state);
5941 add_counter(0, path, name_buf, 64, SCOPE_CPU, COUNTER_USEC,
5947 sprintf(path, "/sys/devices/system/cpu/cpu%d/cpuidle/state%d/name",
5949 input = fopen(path, "r");
5953 err(1, "%s: failed to read file", path);
5963 sprintf(path, "cpuidle/state%d/usage", state);
5968 add_counter(0, path, name_buf, 64, SCOPE_CPU, COUNTER_ITEMS,