Lines Matching refs:ph
227 if (ff->ph->needs_swap) in do_read_u32()
240 if (ff->ph->needs_swap) in do_read_u64()
315 session = container_of(ff->ph, struct perf_session, header); in write_build_id()
887 session = container_of(ff->ph, struct perf_session, header); in write_auxtrace()
898 return do_write(ff, &ff->ph->env.clock.clockid_res_ns, in write_clockid()
899 sizeof(ff->ph->env.clock.clockid_res_ns)); in write_clockid()
917 data32 = ff->ph->env.clock.clockid; in write_clock_data()
924 data64 = &ff->ph->env.clock.tod_ns; in write_clock_data()
931 data64 = &ff->ph->env.clock.clockid_ns; in write_clock_data()
976 session = container_of(ff->ph, struct perf_session, header); in write_dir_format()
989 struct perf_env *env = &ff->ph->env; in write_bpf_prog_info()
1031 struct perf_env *env = &ff->ph->env; in write_bpf_btf()
1444 ret = do_write(ff, &(ff->ph->env.comp_ver), sizeof(ff->ph->env.comp_ver)); in write_compressed()
1448 ret = do_write(ff, &(ff->ph->env.comp_type), sizeof(ff->ph->env.comp_type)); in write_compressed()
1452 ret = do_write(ff, &(ff->ph->env.comp_level), sizeof(ff->ph->env.comp_level)); in write_compressed()
1456 ret = do_write(ff, &(ff->ph->env.comp_ratio), sizeof(ff->ph->env.comp_ratio)); in write_compressed()
1460 return do_write(ff, &(ff->ph->env.comp_mmap_len), sizeof(ff->ph->env.comp_mmap_len)); in write_compressed()
1533 fprintf(fp, "# hostname : %s\n", ff->ph->env.hostname); in print_hostname()
1538 fprintf(fp, "# os release : %s\n", ff->ph->env.os_release); in print_osrelease()
1543 fprintf(fp, "# arch : %s\n", ff->ph->env.arch); in print_arch()
1548 fprintf(fp, "# cpudesc : %s\n", ff->ph->env.cpu_desc); in print_cpudesc()
1553 fprintf(fp, "# nrcpus online : %u\n", ff->ph->env.nr_cpus_online); in print_nrcpus()
1554 fprintf(fp, "# nrcpus avail : %u\n", ff->ph->env.nr_cpus_avail); in print_nrcpus()
1559 fprintf(fp, "# perf version : %s\n", ff->ph->env.version); in print_version()
1566 nr = ff->ph->env.nr_cmdline; in print_cmdline()
1571 char *argv_i = strdup(ff->ph->env.cmdline_argv[i]); in print_cmdline()
1573 fprintf(fp, "%s ", ff->ph->env.cmdline_argv[i]); in print_cmdline()
1593 struct perf_header *ph = ff->ph; in print_cpu_topology() local
1594 int cpu_nr = ph->env.nr_cpus_avail; in print_cpu_topology()
1598 nr = ph->env.nr_sibling_cores; in print_cpu_topology()
1599 str = ph->env.sibling_cores; in print_cpu_topology()
1606 if (ph->env.nr_sibling_dies) { in print_cpu_topology()
1607 nr = ph->env.nr_sibling_dies; in print_cpu_topology()
1608 str = ph->env.sibling_dies; in print_cpu_topology()
1616 nr = ph->env.nr_sibling_threads; in print_cpu_topology()
1617 str = ph->env.sibling_threads; in print_cpu_topology()
1624 if (ph->env.nr_sibling_dies) { in print_cpu_topology()
1625 if (ph->env.cpu != NULL) { in print_cpu_topology()
1629 i, ph->env.cpu[i].core_id, in print_cpu_topology()
1630 ph->env.cpu[i].die_id, in print_cpu_topology()
1631 ph->env.cpu[i].socket_id); in print_cpu_topology()
1636 if (ph->env.cpu != NULL) { in print_cpu_topology()
1640 i, ph->env.cpu[i].core_id, in print_cpu_topology()
1641 ph->env.cpu[i].socket_id); in print_cpu_topology()
1651 ff->ph->env.clock.clockid_res_ns * 1000); in print_clockid()
1663 if (!ff->ph->env.clock.enabled) { in print_clock_data()
1669 ref = ff->ph->env.clock.tod_ns; in print_clock_data()
1675 ref = ff->ph->env.clock.clockid_ns; in print_clock_data()
1680 clockid = ff->ph->env.clock.clockid; in print_clock_data()
1703 for (i = 0; i < ff->ph->env.nr_hybrid_nodes; i++) { in print_hybrid_topology()
1704 n = &ff->ph->env.hybrid_nodes[i]; in print_hybrid_topology()
1714 session = container_of(ff->ph, struct perf_session, header); in print_dir_format()
1723 struct perf_env *env = &ff->ph->env; in print_bpf_prog_info()
1747 struct perf_env *env = &ff->ph->env; in print_bpf_btf()
1856 if (ff->ph->needs_swap) in read_event_desc()
1867 if (ff->ph->needs_swap) in read_event_desc()
1944 fprintf(fp, "# total memory : %llu kB\n", ff->ph->env.total_mem); in print_total_mem()
1952 for (i = 0; i < ff->ph->env.nr_numa_nodes; i++) { in print_numa_topology()
1953 n = &ff->ph->env.numa_nodes[i]; in print_numa_topology()
1966 fprintf(fp, "# cpuid : %s\n", ff->ph->env.cpuid); in print_cpuid()
1989 for (i = 0; i < ff->ph->env.caches_cnt; i++) { in print_cache()
1991 cpu_cache_level__fprintf(fp, &ff->ph->env.caches[i]); in print_cache()
1998 ff->ph->env.comp_type == PERF_COMP_ZSTD ? "Zstd" : "Unknown", in print_compressed()
1999 ff->ph->env.comp_level, ff->ph->env.comp_ratio); in print_compressed()
2035 print_per_cpu_pmu_caps(fp, ff->ph->env.nr_cpu_pmu_caps, in print_cpu_pmu_caps()
2036 ff->ph->env.cpu_pmu_caps, NULL); in print_cpu_pmu_caps()
2043 for (int i = 0; i < ff->ph->env.nr_hybrid_cpc_nodes; i++) { in print_hybrid_cpu_pmu_caps()
2044 n = &ff->ph->env.hybrid_cpc_nodes[i]; in print_hybrid_cpu_pmu_caps()
2058 pmu_num = ff->ph->env.nr_pmu_mappings; in print_pmu_mappings()
2064 str = ff->ph->env.pmu_mappings; in print_pmu_mappings()
2093 session = container_of(ff->ph, struct perf_session, header); in print_group_desc()
2115 session = container_of(ff->ph, struct perf_session, header); in print_sample_time()
2149 nodes = ff->ph->env.memory_nodes; in print_mem_topology()
2150 nr = ff->ph->env.nr_memory_nodes; in print_mem_topology()
2153 nr, ff->ph->env.memory_bsize); in print_mem_topology()
2156 memory_node__fprintf(&nodes[i], ff->ph->env.memory_bsize, fp); in print_mem_topology()
2323 ff->ph->env.__feat_env = do_read_string(ff); \
2324 return ff->ph->env.__feat_env ? 0 : -ENOMEM; \
2343 if (perf_header__read_build_ids(ff->ph, ff->fd, ff->offset, ff->size)) in process_build_id()
2360 ff->ph->env.nr_cpus_avail = (int)nr_cpus_avail; in process_nrcpus()
2361 ff->ph->env.nr_cpus_online = (int)nr_cpus_online; in process_nrcpus()
2373 ff->ph->env.total_mem = (unsigned long long)total_mem; in process_total_mem()
2415 session = container_of(ff->ph, struct perf_session, header); in process_event_desc()
2440 ff->ph->env.nr_cmdline = nr; in process_cmdline()
2460 ff->ph->env.cmdline = cmdline; in process_cmdline()
2461 ff->ph->env.cmdline_argv = (const char **) argv; in process_cmdline()
2475 int cpu_nr = ff->ph->env.nr_cpus_avail; in process_cpu_topology()
2477 struct perf_header *ph = ff->ph; in process_cpu_topology() local
2480 ph->env.cpu = calloc(cpu_nr, sizeof(*ph->env.cpu)); in process_cpu_topology()
2481 if (!ph->env.cpu) in process_cpu_topology()
2487 ph->env.nr_sibling_cores = nr; in process_cpu_topology()
2503 ph->env.sibling_cores = strbuf_detach(&sb, NULL); in process_cpu_topology()
2508 ph->env.nr_sibling_threads = nr; in process_cpu_topology()
2522 ph->env.sibling_threads = strbuf_detach(&sb, NULL); in process_cpu_topology()
2529 zfree(&ph->env.cpu); in process_cpu_topology()
2538 if (ph->env.arch && (!strncmp(ph->env.arch, "s390", 4) in process_cpu_topology()
2539 || !strncmp(ph->env.arch, "aarch64", 7))) in process_cpu_topology()
2546 ph->env.cpu[i].core_id = nr; in process_cpu_topology()
2558 ph->env.cpu[i].socket_id = nr; in process_cpu_topology()
2572 ph->env.nr_sibling_dies = nr; in process_cpu_topology()
2586 ph->env.sibling_dies = strbuf_detach(&sb, NULL); in process_cpu_topology()
2592 ph->env.cpu[i].die_id = nr; in process_cpu_topology()
2600 zfree(&ph->env.cpu); in process_cpu_topology()
2641 ff->ph->env.nr_numa_nodes = nr; in process_numa_topology()
2642 ff->ph->env.numa_nodes = nodes; in process_numa_topology()
2665 ff->ph->env.nr_pmu_mappings = pmu_num; in process_pmu_mappings()
2684 ff->ph->env.msr_pmu_type = type; in process_pmu_mappings()
2689 ff->ph->env.pmu_mappings = strbuf_detach(&sb, NULL); in process_pmu_mappings()
2712 ff->ph->env.nr_groups = nr_groups; in process_group_desc()
2737 session = container_of(ff->ph, struct perf_session, header); in process_group_desc()
2786 session = container_of(ff->ph, struct perf_session, header); in process_auxtrace()
2789 ff->ph->needs_swap); in process_auxtrace()
2839 ff->ph->env.caches = caches; in process_cache()
2840 ff->ph->env.caches_cnt = cnt; in process_cache()
2853 session = container_of(ff->ph, struct perf_session, header); in process_sample_time()
2909 ff->ph->env.memory_bsize = bsize; in process_mem_topology()
2910 ff->ph->env.memory_nodes = nodes; in process_mem_topology()
2911 ff->ph->env.nr_memory_nodes = nr; in process_mem_topology()
2923 if (do_read_u64(ff, &ff->ph->env.clock.clockid_res_ns)) in process_clockid()
2946 ff->ph->env.clock.clockid = data32; in process_clock_data()
2952 ff->ph->env.clock.tod_ns = data64; in process_clock_data()
2958 ff->ph->env.clock.clockid_ns = data64; in process_clock_data()
2959 ff->ph->env.clock.enabled = true; in process_clock_data()
2989 ff->ph->env.nr_hybrid_nodes = nr; in process_hybrid_topology()
2990 ff->ph->env.hybrid_nodes = nodes; in process_hybrid_topology()
3009 session = container_of(ff->ph, struct perf_session, header); in process_dir_format()
3023 struct perf_env *env = &ff->ph->env; in process_bpf_prog_info()
3027 if (ff->ph->needs_swap) { in process_bpf_prog_info()
3090 struct perf_env *env = &ff->ph->env; in process_bpf_btf()
3095 if (ff->ph->needs_swap) { in process_bpf_btf()
3138 if (do_read_u32(ff, &(ff->ph->env.comp_ver))) in process_compressed()
3141 if (do_read_u32(ff, &(ff->ph->env.comp_type))) in process_compressed()
3144 if (do_read_u32(ff, &(ff->ph->env.comp_level))) in process_compressed()
3147 if (do_read_u32(ff, &(ff->ph->env.comp_ratio))) in process_compressed()
3150 if (do_read_u32(ff, &(ff->ph->env.comp_mmap_len))) in process_compressed()
3214 return process_per_cpu_pmu_caps(ff, &ff->ph->env.nr_cpu_pmu_caps, in process_cpu_pmu_caps()
3215 &ff->ph->env.cpu_pmu_caps, in process_cpu_pmu_caps()
3216 &ff->ph->env.max_branches); in process_cpu_pmu_caps()
3254 ff->ph->env.nr_hybrid_cpc_nodes = nr_pmu; in process_hybrid_cpu_pmu_caps()
3255 ff->ph->env.hybrid_cpc_nodes = nodes; in process_hybrid_cpu_pmu_caps()
3339 struct perf_header *ph, in perf_file_section__fprintf_info() argument
3359 .ph = ph, in perf_file_section__fprintf_info()
3418 if (perf_header__has_feat(ff->ph, type)) { in do_write_feat()
3455 .ph = header, in perf_header__adds_write()
3612 struct perf_header *ph, in perf_header__process_sections() argument
3663 static int try_all_file_abis(uint64_t hdr_sz, struct perf_header *ph) in try_all_file_abis() argument
3676 ph->needs_swap = true; in try_all_file_abis()
3680 ph->needs_swap); in try_all_file_abis()
3701 static int try_all_pipe_abis(uint64_t hdr_sz, struct perf_header *ph) in try_all_pipe_abis() argument
3712 ph->needs_swap = true; in try_all_pipe_abis()
3731 bool is_pipe, struct perf_header *ph) in check_magic_endian() argument
3738 ph->version = PERF_HEADER_VERSION_1; in check_magic_endian()
3741 return try_all_pipe_abis(hdr_sz, ph); in check_magic_endian()
3743 return try_all_file_abis(hdr_sz, ph); in check_magic_endian()
3750 ph->version = PERF_HEADER_VERSION_2; in check_magic_endian()
3760 ph->needs_swap = true; in check_magic_endian()
3766 struct perf_header *ph, int fd) in perf_file_header__read() argument
3777 header->attr_size, false, ph) < 0) { in perf_file_header__read()
3782 if (ph->needs_swap) { in perf_file_header__read()
3793 } else if (ph->needs_swap) { in perf_file_header__read()
3828 memcpy(&ph->adds_features, &header->adds_features, in perf_file_header__read()
3829 sizeof(ph->adds_features)); in perf_file_header__read()
3831 ph->data_offset = header->data.offset; in perf_file_header__read()
3832 ph->data_size = header->data.size; in perf_file_header__read()
3833 ph->feat_offset = header->data.offset + header->data.size; in perf_file_header__read()
3838 struct perf_header *ph, in perf_file_section__process() argument
3843 .ph = ph, in perf_file_section__process()
3866 struct perf_header *ph, in perf_file_header__read_pipe() argument
3872 .ph = ph, in perf_file_header__read_pipe()
3880 if (check_magic_endian(header->magic, header->size, true, ph) < 0) { in perf_file_header__read_pipe()
3885 if (ph->needs_swap) in perf_file_header__read_pipe()
3908 static int read_attr(int fd, struct perf_header *ph, in read_attr() argument
3929 if (ph->needs_swap) in read_attr()
4141 ff.ph = &session->header; in perf_event__process_feature()