Lines Matching refs:ph
228 if (ff->ph->needs_swap) in do_read_u32()
241 if (ff->ph->needs_swap) in do_read_u64()
316 session = container_of(ff->ph, struct perf_session, header); in write_build_id()
888 session = container_of(ff->ph, struct perf_session, header); in write_auxtrace()
899 return do_write(ff, &ff->ph->env.clock.clockid_res_ns, in write_clockid()
900 sizeof(ff->ph->env.clock.clockid_res_ns)); in write_clockid()
918 data32 = ff->ph->env.clock.clockid; in write_clock_data()
925 data64 = &ff->ph->env.clock.tod_ns; in write_clock_data()
932 data64 = &ff->ph->env.clock.clockid_ns; in write_clock_data()
977 session = container_of(ff->ph, struct perf_session, header); in write_dir_format()
990 struct perf_env *env = &ff->ph->env; in write_bpf_prog_info()
1032 struct perf_env *env = &ff->ph->env; in write_bpf_btf()
1445 ret = do_write(ff, &(ff->ph->env.comp_ver), sizeof(ff->ph->env.comp_ver)); in write_compressed()
1449 ret = do_write(ff, &(ff->ph->env.comp_type), sizeof(ff->ph->env.comp_type)); in write_compressed()
1453 ret = do_write(ff, &(ff->ph->env.comp_level), sizeof(ff->ph->env.comp_level)); in write_compressed()
1457 ret = do_write(ff, &(ff->ph->env.comp_ratio), sizeof(ff->ph->env.comp_ratio)); in write_compressed()
1461 return do_write(ff, &(ff->ph->env.comp_mmap_len), sizeof(ff->ph->env.comp_mmap_len)); in write_compressed()
1534 fprintf(fp, "# hostname : %s\n", ff->ph->env.hostname); in print_hostname()
1539 fprintf(fp, "# os release : %s\n", ff->ph->env.os_release); in print_osrelease()
1544 fprintf(fp, "# arch : %s\n", ff->ph->env.arch); in print_arch()
1549 fprintf(fp, "# cpudesc : %s\n", ff->ph->env.cpu_desc); in print_cpudesc()
1554 fprintf(fp, "# nrcpus online : %u\n", ff->ph->env.nr_cpus_online); in print_nrcpus()
1555 fprintf(fp, "# nrcpus avail : %u\n", ff->ph->env.nr_cpus_avail); in print_nrcpus()
1560 fprintf(fp, "# perf version : %s\n", ff->ph->env.version); in print_version()
1567 nr = ff->ph->env.nr_cmdline; in print_cmdline()
1572 char *argv_i = strdup(ff->ph->env.cmdline_argv[i]); in print_cmdline()
1574 fprintf(fp, "%s ", ff->ph->env.cmdline_argv[i]); in print_cmdline()
1594 struct perf_header *ph = ff->ph; in print_cpu_topology() local
1595 int cpu_nr = ph->env.nr_cpus_avail; in print_cpu_topology()
1599 nr = ph->env.nr_sibling_cores; in print_cpu_topology()
1600 str = ph->env.sibling_cores; in print_cpu_topology()
1607 if (ph->env.nr_sibling_dies) { in print_cpu_topology()
1608 nr = ph->env.nr_sibling_dies; in print_cpu_topology()
1609 str = ph->env.sibling_dies; in print_cpu_topology()
1617 nr = ph->env.nr_sibling_threads; in print_cpu_topology()
1618 str = ph->env.sibling_threads; in print_cpu_topology()
1625 if (ph->env.nr_sibling_dies) { in print_cpu_topology()
1626 if (ph->env.cpu != NULL) { in print_cpu_topology()
1630 i, ph->env.cpu[i].core_id, in print_cpu_topology()
1631 ph->env.cpu[i].die_id, in print_cpu_topology()
1632 ph->env.cpu[i].socket_id); in print_cpu_topology()
1637 if (ph->env.cpu != NULL) { in print_cpu_topology()
1641 i, ph->env.cpu[i].core_id, in print_cpu_topology()
1642 ph->env.cpu[i].socket_id); in print_cpu_topology()
1652 ff->ph->env.clock.clockid_res_ns * 1000); in print_clockid()
1664 if (!ff->ph->env.clock.enabled) { in print_clock_data()
1670 ref = ff->ph->env.clock.tod_ns; in print_clock_data()
1676 ref = ff->ph->env.clock.clockid_ns; in print_clock_data()
1681 clockid = ff->ph->env.clock.clockid; in print_clock_data()
1704 for (i = 0; i < ff->ph->env.nr_hybrid_nodes; i++) { in print_hybrid_topology()
1705 n = &ff->ph->env.hybrid_nodes[i]; in print_hybrid_topology()
1715 session = container_of(ff->ph, struct perf_session, header); in print_dir_format()
1724 struct perf_env *env = &ff->ph->env; in print_bpf_prog_info()
1748 struct perf_env *env = &ff->ph->env; in print_bpf_btf()
1857 if (ff->ph->needs_swap) in read_event_desc()
1868 if (ff->ph->needs_swap) in read_event_desc()
1945 fprintf(fp, "# total memory : %llu kB\n", ff->ph->env.total_mem); in print_total_mem()
1953 for (i = 0; i < ff->ph->env.nr_numa_nodes; i++) { in print_numa_topology()
1954 n = &ff->ph->env.numa_nodes[i]; in print_numa_topology()
1967 fprintf(fp, "# cpuid : %s\n", ff->ph->env.cpuid); in print_cpuid()
1990 for (i = 0; i < ff->ph->env.caches_cnt; i++) { in print_cache()
1992 cpu_cache_level__fprintf(fp, &ff->ph->env.caches[i]); in print_cache()
1999 ff->ph->env.comp_type == PERF_COMP_ZSTD ? "Zstd" : "Unknown", in print_compressed()
2000 ff->ph->env.comp_level, ff->ph->env.comp_ratio); in print_compressed()
2036 print_per_cpu_pmu_caps(fp, ff->ph->env.nr_cpu_pmu_caps, in print_cpu_pmu_caps()
2037 ff->ph->env.cpu_pmu_caps, NULL); in print_cpu_pmu_caps()
2044 for (int i = 0; i < ff->ph->env.nr_hybrid_cpc_nodes; i++) { in print_hybrid_cpu_pmu_caps()
2045 n = &ff->ph->env.hybrid_cpc_nodes[i]; in print_hybrid_cpu_pmu_caps()
2059 pmu_num = ff->ph->env.nr_pmu_mappings; in print_pmu_mappings()
2065 str = ff->ph->env.pmu_mappings; in print_pmu_mappings()
2094 session = container_of(ff->ph, struct perf_session, header); in print_group_desc()
2116 session = container_of(ff->ph, struct perf_session, header); in print_sample_time()
2150 nodes = ff->ph->env.memory_nodes; in print_mem_topology()
2151 nr = ff->ph->env.nr_memory_nodes; in print_mem_topology()
2154 nr, ff->ph->env.memory_bsize); in print_mem_topology()
2157 memory_node__fprintf(&nodes[i], ff->ph->env.memory_bsize, fp); in print_mem_topology()
2324 free(ff->ph->env.__feat_env); \
2325 ff->ph->env.__feat_env = do_read_string(ff); \
2326 return ff->ph->env.__feat_env ? 0 : -ENOMEM; \
2345 if (perf_header__read_build_ids(ff->ph, ff->fd, ff->offset, ff->size)) in process_build_id()
2362 ff->ph->env.nr_cpus_avail = (int)nr_cpus_avail; in process_nrcpus()
2363 ff->ph->env.nr_cpus_online = (int)nr_cpus_online; in process_nrcpus()
2375 ff->ph->env.total_mem = (unsigned long long)total_mem; in process_total_mem()
2417 session = container_of(ff->ph, struct perf_session, header); in process_event_desc()
2442 ff->ph->env.nr_cmdline = nr; in process_cmdline()
2462 ff->ph->env.cmdline = cmdline; in process_cmdline()
2463 ff->ph->env.cmdline_argv = (const char **) argv; in process_cmdline()
2477 int cpu_nr = ff->ph->env.nr_cpus_avail; in process_cpu_topology()
2479 struct perf_header *ph = ff->ph; in process_cpu_topology() local
2482 ph->env.cpu = calloc(cpu_nr, sizeof(*ph->env.cpu)); in process_cpu_topology()
2483 if (!ph->env.cpu) in process_cpu_topology()
2489 ph->env.nr_sibling_cores = nr; in process_cpu_topology()
2505 ph->env.sibling_cores = strbuf_detach(&sb, NULL); in process_cpu_topology()
2510 ph->env.nr_sibling_threads = nr; in process_cpu_topology()
2524 ph->env.sibling_threads = strbuf_detach(&sb, NULL); in process_cpu_topology()
2531 zfree(&ph->env.cpu); in process_cpu_topology()
2540 if (ph->env.arch && (!strncmp(ph->env.arch, "s390", 4) in process_cpu_topology()
2541 || !strncmp(ph->env.arch, "aarch64", 7))) in process_cpu_topology()
2548 ph->env.cpu[i].core_id = nr; in process_cpu_topology()
2560 ph->env.cpu[i].socket_id = nr; in process_cpu_topology()
2574 ph->env.nr_sibling_dies = nr; in process_cpu_topology()
2588 ph->env.sibling_dies = strbuf_detach(&sb, NULL); in process_cpu_topology()
2594 ph->env.cpu[i].die_id = nr; in process_cpu_topology()
2602 zfree(&ph->env.cpu); in process_cpu_topology()
2643 ff->ph->env.nr_numa_nodes = nr; in process_numa_topology()
2644 ff->ph->env.numa_nodes = nodes; in process_numa_topology()
2667 ff->ph->env.nr_pmu_mappings = pmu_num; in process_pmu_mappings()
2686 ff->ph->env.msr_pmu_type = type; in process_pmu_mappings()
2691 ff->ph->env.pmu_mappings = strbuf_detach(&sb, NULL); in process_pmu_mappings()
2714 ff->ph->env.nr_groups = nr_groups; in process_group_desc()
2739 session = container_of(ff->ph, struct perf_session, header); in process_group_desc()
2788 session = container_of(ff->ph, struct perf_session, header); in process_auxtrace()
2791 ff->ph->needs_swap); in process_auxtrace()
2841 ff->ph->env.caches = caches; in process_cache()
2842 ff->ph->env.caches_cnt = cnt; in process_cache()
2855 session = container_of(ff->ph, struct perf_session, header); in process_sample_time()
2911 ff->ph->env.memory_bsize = bsize; in process_mem_topology()
2912 ff->ph->env.memory_nodes = nodes; in process_mem_topology()
2913 ff->ph->env.nr_memory_nodes = nr; in process_mem_topology()
2925 if (do_read_u64(ff, &ff->ph->env.clock.clockid_res_ns)) in process_clockid()
2948 ff->ph->env.clock.clockid = data32; in process_clock_data()
2954 ff->ph->env.clock.tod_ns = data64; in process_clock_data()
2960 ff->ph->env.clock.clockid_ns = data64; in process_clock_data()
2961 ff->ph->env.clock.enabled = true; in process_clock_data()
2991 ff->ph->env.nr_hybrid_nodes = nr; in process_hybrid_topology()
2992 ff->ph->env.hybrid_nodes = nodes; in process_hybrid_topology()
3011 session = container_of(ff->ph, struct perf_session, header); in process_dir_format()
3024 struct perf_env *env = &ff->ph->env; in process_bpf_prog_info()
3029 if (ff->ph->needs_swap) { in process_bpf_prog_info()
3092 struct perf_env *env = &ff->ph->env; in process_bpf_btf()
3097 if (ff->ph->needs_swap) { in process_bpf_btf()
3140 if (do_read_u32(ff, &(ff->ph->env.comp_ver))) in process_compressed()
3143 if (do_read_u32(ff, &(ff->ph->env.comp_type))) in process_compressed()
3146 if (do_read_u32(ff, &(ff->ph->env.comp_level))) in process_compressed()
3149 if (do_read_u32(ff, &(ff->ph->env.comp_ratio))) in process_compressed()
3152 if (do_read_u32(ff, &(ff->ph->env.comp_mmap_len))) in process_compressed()
3216 return process_per_cpu_pmu_caps(ff, &ff->ph->env.nr_cpu_pmu_caps, in process_cpu_pmu_caps()
3217 &ff->ph->env.cpu_pmu_caps, in process_cpu_pmu_caps()
3218 &ff->ph->env.max_branches); in process_cpu_pmu_caps()
3256 ff->ph->env.nr_hybrid_cpc_nodes = nr_pmu; in process_hybrid_cpu_pmu_caps()
3257 ff->ph->env.hybrid_cpc_nodes = nodes; in process_hybrid_cpu_pmu_caps()
3341 struct perf_header *ph, in perf_file_section__fprintf_info() argument
3361 .ph = ph, in perf_file_section__fprintf_info()
3420 if (perf_header__has_feat(ff->ph, type)) { in do_write_feat()
3457 .ph = header, in perf_header__adds_write()
3614 struct perf_header *ph, in perf_header__process_sections() argument
3665 static int try_all_file_abis(uint64_t hdr_sz, struct perf_header *ph) in try_all_file_abis() argument
3678 ph->needs_swap = true; in try_all_file_abis()
3682 ph->needs_swap); in try_all_file_abis()
3703 static int try_all_pipe_abis(uint64_t hdr_sz, struct perf_header *ph) in try_all_pipe_abis() argument
3714 ph->needs_swap = true; in try_all_pipe_abis()
3733 bool is_pipe, struct perf_header *ph) in check_magic_endian() argument
3740 ph->version = PERF_HEADER_VERSION_1; in check_magic_endian()
3743 return try_all_pipe_abis(hdr_sz, ph); in check_magic_endian()
3745 return try_all_file_abis(hdr_sz, ph); in check_magic_endian()
3752 ph->version = PERF_HEADER_VERSION_2; in check_magic_endian()
3762 ph->needs_swap = true; in check_magic_endian()
3768 struct perf_header *ph, int fd) in perf_file_header__read() argument
3779 header->attr_size, false, ph) < 0) { in perf_file_header__read()
3784 if (ph->needs_swap) { in perf_file_header__read()
3795 } else if (ph->needs_swap) { in perf_file_header__read()
3830 memcpy(&ph->adds_features, &header->adds_features, in perf_file_header__read()
3831 sizeof(ph->adds_features)); in perf_file_header__read()
3833 ph->data_offset = header->data.offset; in perf_file_header__read()
3834 ph->data_size = header->data.size; in perf_file_header__read()
3835 ph->feat_offset = header->data.offset + header->data.size; in perf_file_header__read()
3840 struct perf_header *ph, in perf_file_section__process() argument
3845 .ph = ph, in perf_file_section__process()
3868 struct perf_header *ph, in perf_file_header__read_pipe() argument
3874 .ph = ph, in perf_file_header__read_pipe()
3882 if (check_magic_endian(header->magic, header->size, true, ph) < 0) { in perf_file_header__read_pipe()
3887 if (ph->needs_swap) in perf_file_header__read_pipe()
3910 static int read_attr(int fd, struct perf_header *ph, in read_attr() argument
3931 if (ph->needs_swap) in read_attr()
4144 ff.ph = &session->header; in perf_event__process_feature()