Lines Matching refs:file

68  * to detect endianness when reading the perf.data file
389 FILE *file;
399 file = fopen("/proc/cpuinfo", "r");
400 if (!file)
403 while (getline(&buf, &len, file) > 0) {
438 fclose(file);
1012 * Check if /sys/devices/system/cpu/cpux/online file
1013 * exists. Some cases cpu0 won't have online file since
1016 * file won't exist
1024 * Read online file using sysfs__read_str.
1026 * If read succeeds, return value from file
1068 /* before writing to file, translate address to offset */
1154 char path[PATH_MAX], file[PATH_MAX];
1159 scnprintf(file, PATH_MAX, "%s/%s", sysfs__mountpoint(), path);
1161 if (stat(file, &st))
1164 scnprintf(file, PATH_MAX, "%s/level", path);
1165 if (sysfs__read_int(file, (int *) &cache->level))
1168 scnprintf(file, PATH_MAX, "%s/coherency_line_size", path);
1169 if (sysfs__read_int(file, (int *) &cache->line_size))
1172 scnprintf(file, PATH_MAX, "%s/number_of_sets", path);
1173 if (sysfs__read_int(file, (int *) &cache->sets))
1176 scnprintf(file, PATH_MAX, "%s/ways_of_associativity", path);
1177 if (sysfs__read_int(file, (int *) &cache->ways))
1180 scnprintf(file, PATH_MAX, "%s/type", path);
1181 if (sysfs__read_str(file, &cache->type, &len))
1187 scnprintf(file, PATH_MAX, "%s/size", path);
1188 if (sysfs__read_str(file, &cache->size, &len)) {
1196 scnprintf(file, PATH_MAX, "%s/shared_cpu_list", path);
1197 if (sysfs__read_str(file, &cache->map, &len)) {
1946 /* buffer to hold on file attr struct */
1964 * must read entire on-file attr struct to
2398 * Added a field to struct perf_record_header_build_id that broke the file
3177 /* after reading from file, translate offset to address */
3556 * file.
3685 * from an older file. Update attr size so that
3832 * In the legacy file format, the magic number is not used to encode endianness.
3852 pr_debug("ABI%d perf.data file detected, need_swap=%d\n",
3872 * redirected into a file and analyzed on a different machine with possibly a
3888 pr_debug("Pipe ABI%d perf.data file detected\n", i);
3922 * - encode endianness of file
3971 * generated the data file and the host analyzing the file.
3974 * the unsigned long where the file was generated. Take a best
3975 * guess at determining it: try 64-bit swap first (ie., file
3980 * file), punt and fallback to the original behavior --
4075 pr_debug("incompatible file format\n");
4100 /* on file perf_event_attr size */
4110 pr_debug("file uses a more recent and unsupported ABI"
4192 * We can read 'pipe' data event from regular file,
4212 * If data size is still 0 then the file contains only partial
4216 pr_warning("WARNING: The %s file's data size field is 0 which is unexpected.\n"
4218 data->file.path);
4222 pr_err("ERROR: The %s file's attr size field is 0 which is unexpected.\n"
4224 data->file.path);
4477 * 'pipe' data from regular file. The trace_report reads
4494 pr_err("%s: reading input file", __func__);