Lines Matching refs:ph
234 if (ff->ph->needs_swap) in do_read_u32()
247 if (ff->ph->needs_swap) in do_read_u64()
324 session = container_of(ff->ph, struct perf_session, header); in write_build_id()
892 session = container_of(ff->ph, struct perf_session, header); in write_auxtrace()
903 return do_write(ff, &ff->ph->env.clock.clockid_res_ns, in write_clockid()
904 sizeof(ff->ph->env.clock.clockid_res_ns)); in write_clockid()
922 data32 = ff->ph->env.clock.clockid; in write_clock_data()
929 data64 = &ff->ph->env.clock.tod_ns; in write_clock_data()
936 data64 = &ff->ph->env.clock.clockid_ns; in write_clock_data()
981 session = container_of(ff->ph, struct perf_session, header); in write_dir_format()
1045 struct perf_env *env = &ff->ph->env; in write_bpf_prog_info()
1087 struct perf_env *env = &ff->ph->env; in write_bpf_btf()
1532 ret = do_write(ff, &(ff->ph->env.comp_ver), sizeof(ff->ph->env.comp_ver)); in write_compressed()
1536 ret = do_write(ff, &(ff->ph->env.comp_type), sizeof(ff->ph->env.comp_type)); in write_compressed()
1540 ret = do_write(ff, &(ff->ph->env.comp_level), sizeof(ff->ph->env.comp_level)); in write_compressed()
1544 ret = do_write(ff, &(ff->ph->env.comp_ratio), sizeof(ff->ph->env.comp_ratio)); in write_compressed()
1548 return do_write(ff, &(ff->ph->env.comp_mmap_len), sizeof(ff->ph->env.comp_mmap_len)); in write_compressed()
1645 fprintf(fp, "# hostname : %s\n", ff->ph->env.hostname); in print_hostname()
1650 fprintf(fp, "# os release : %s\n", ff->ph->env.os_release); in print_osrelease()
1655 fprintf(fp, "# arch : %s\n", ff->ph->env.arch); in print_arch()
1660 fprintf(fp, "# cpudesc : %s\n", ff->ph->env.cpu_desc); in print_cpudesc()
1665 fprintf(fp, "# nrcpus online : %u\n", ff->ph->env.nr_cpus_online); in print_nrcpus()
1666 fprintf(fp, "# nrcpus avail : %u\n", ff->ph->env.nr_cpus_avail); in print_nrcpus()
1671 fprintf(fp, "# perf version : %s\n", ff->ph->env.version); in print_version()
1678 nr = ff->ph->env.nr_cmdline; in print_cmdline()
1683 char *argv_i = strdup(ff->ph->env.cmdline_argv[i]); in print_cmdline()
1685 fprintf(fp, "%s ", ff->ph->env.cmdline_argv[i]); in print_cmdline()
1705 struct perf_header *ph = ff->ph; in print_cpu_topology() local
1706 int cpu_nr = ph->env.nr_cpus_avail; in print_cpu_topology()
1710 nr = ph->env.nr_sibling_cores; in print_cpu_topology()
1711 str = ph->env.sibling_cores; in print_cpu_topology()
1718 if (ph->env.nr_sibling_dies) { in print_cpu_topology()
1719 nr = ph->env.nr_sibling_dies; in print_cpu_topology()
1720 str = ph->env.sibling_dies; in print_cpu_topology()
1728 nr = ph->env.nr_sibling_threads; in print_cpu_topology()
1729 str = ph->env.sibling_threads; in print_cpu_topology()
1736 if (ph->env.nr_sibling_dies) { in print_cpu_topology()
1737 if (ph->env.cpu != NULL) { in print_cpu_topology()
1741 i, ph->env.cpu[i].core_id, in print_cpu_topology()
1742 ph->env.cpu[i].die_id, in print_cpu_topology()
1743 ph->env.cpu[i].socket_id); in print_cpu_topology()
1748 if (ph->env.cpu != NULL) { in print_cpu_topology()
1752 i, ph->env.cpu[i].core_id, in print_cpu_topology()
1753 ph->env.cpu[i].socket_id); in print_cpu_topology()
1763 ff->ph->env.clock.clockid_res_ns * 1000); in print_clockid()
1775 if (!ff->ph->env.clock.enabled) { in print_clock_data()
1781 ref = ff->ph->env.clock.tod_ns; in print_clock_data()
1787 ref = ff->ph->env.clock.clockid_ns; in print_clock_data()
1792 clockid = ff->ph->env.clock.clockid; in print_clock_data()
1815 for (i = 0; i < ff->ph->env.nr_hybrid_nodes; i++) { in print_hybrid_topology()
1816 n = &ff->ph->env.hybrid_nodes[i]; in print_hybrid_topology()
1826 session = container_of(ff->ph, struct perf_session, header); in print_dir_format()
1835 struct perf_env *env = &ff->ph->env; in print_bpf_prog_info()
1859 struct perf_env *env = &ff->ph->env; in print_bpf_btf()
1968 if (ff->ph->needs_swap) in read_event_desc()
1979 if (ff->ph->needs_swap) in read_event_desc()
2056 fprintf(fp, "# total memory : %llu kB\n", ff->ph->env.total_mem); in print_total_mem()
2064 for (i = 0; i < ff->ph->env.nr_numa_nodes; i++) { in print_numa_topology()
2065 n = &ff->ph->env.numa_nodes[i]; in print_numa_topology()
2078 fprintf(fp, "# cpuid : %s\n", ff->ph->env.cpuid); in print_cpuid()
2101 for (i = 0; i < ff->ph->env.caches_cnt; i++) { in print_cache()
2103 cpu_cache_level__fprintf(fp, &ff->ph->env.caches[i]); in print_cache()
2110 ff->ph->env.comp_type == PERF_COMP_ZSTD ? "Zstd" : "Unknown", in print_compressed()
2111 ff->ph->env.comp_level, ff->ph->env.comp_ratio); in print_compressed()
2135 __print_pmu_caps(fp, ff->ph->env.nr_cpu_pmu_caps, in print_cpu_pmu_caps()
2136 ff->ph->env.cpu_pmu_caps, (char *)"cpu"); in print_cpu_pmu_caps()
2143 for (int i = 0; i < ff->ph->env.nr_pmus_with_caps; i++) { in print_pmu_caps()
2144 pmu_caps = &ff->ph->env.pmu_caps[i]; in print_pmu_caps()
2157 pmu_num = ff->ph->env.nr_pmu_mappings; in print_pmu_mappings()
2163 str = ff->ph->env.pmu_mappings; in print_pmu_mappings()
2192 session = container_of(ff->ph, struct perf_session, header); in print_group_desc()
2214 session = container_of(ff->ph, struct perf_session, header); in print_sample_time()
2248 nodes = ff->ph->env.memory_nodes; in print_mem_topology()
2249 nr = ff->ph->env.nr_memory_nodes; in print_mem_topology()
2252 nr, ff->ph->env.memory_bsize); in print_mem_topology()
2255 memory_node__fprintf(&nodes[i], ff->ph->env.memory_bsize, fp); in print_mem_topology()
2423 free(ff->ph->env.__feat_env); \
2424 ff->ph->env.__feat_env = do_read_string(ff); \
2425 return ff->ph->env.__feat_env ? 0 : -ENOMEM; \
2446 if (perf_header__read_build_ids(ff->ph, ff->fd, ff->offset, ff->size)) in process_build_id()
2463 ff->ph->env.nr_cpus_avail = (int)nr_cpus_avail; in process_nrcpus()
2464 ff->ph->env.nr_cpus_online = (int)nr_cpus_online; in process_nrcpus()
2476 ff->ph->env.total_mem = (unsigned long long)total_mem; in process_total_mem()
2518 session = container_of(ff->ph, struct perf_session, header); in process_event_desc()
2543 ff->ph->env.nr_cmdline = nr; in process_cmdline()
2563 ff->ph->env.cmdline = cmdline; in process_cmdline()
2564 ff->ph->env.cmdline_argv = (const char **) argv; in process_cmdline()
2578 int cpu_nr = ff->ph->env.nr_cpus_avail; in process_cpu_topology()
2580 struct perf_header *ph = ff->ph; in process_cpu_topology() local
2583 ph->env.cpu = calloc(cpu_nr, sizeof(*ph->env.cpu)); in process_cpu_topology()
2584 if (!ph->env.cpu) in process_cpu_topology()
2590 ph->env.nr_sibling_cores = nr; in process_cpu_topology()
2606 ph->env.sibling_cores = strbuf_detach(&sb, NULL); in process_cpu_topology()
2611 ph->env.nr_sibling_threads = nr; in process_cpu_topology()
2625 ph->env.sibling_threads = strbuf_detach(&sb, NULL); in process_cpu_topology()
2632 zfree(&ph->env.cpu); in process_cpu_topology()
2641 if (ph->env.arch && (!strncmp(ph->env.arch, "s390", 4) in process_cpu_topology()
2642 || !strncmp(ph->env.arch, "aarch64", 7))) in process_cpu_topology()
2649 ph->env.cpu[i].core_id = nr; in process_cpu_topology()
2661 ph->env.cpu[i].socket_id = nr; in process_cpu_topology()
2675 ph->env.nr_sibling_dies = nr; in process_cpu_topology()
2689 ph->env.sibling_dies = strbuf_detach(&sb, NULL); in process_cpu_topology()
2695 ph->env.cpu[i].die_id = nr; in process_cpu_topology()
2703 zfree(&ph->env.cpu); in process_cpu_topology()
2744 ff->ph->env.nr_numa_nodes = nr; in process_numa_topology()
2745 ff->ph->env.numa_nodes = nodes; in process_numa_topology()
2768 ff->ph->env.nr_pmu_mappings = pmu_num; in process_pmu_mappings()
2787 ff->ph->env.msr_pmu_type = type; in process_pmu_mappings()
2792 ff->ph->env.pmu_mappings = strbuf_detach(&sb, NULL); in process_pmu_mappings()
2815 ff->ph->env.nr_groups = nr_groups; in process_group_desc()
2840 session = container_of(ff->ph, struct perf_session, header); in process_group_desc()
2888 session = container_of(ff->ph, struct perf_session, header); in process_auxtrace()
2891 ff->ph->needs_swap); in process_auxtrace()
2941 ff->ph->env.caches = caches; in process_cache()
2942 ff->ph->env.caches_cnt = cnt; in process_cache()
2955 session = container_of(ff->ph, struct perf_session, header); in process_sample_time()
3011 ff->ph->env.memory_bsize = bsize; in process_mem_topology()
3012 ff->ph->env.memory_nodes = nodes; in process_mem_topology()
3013 ff->ph->env.nr_memory_nodes = nr; in process_mem_topology()
3025 if (do_read_u64(ff, &ff->ph->env.clock.clockid_res_ns)) in process_clockid()
3048 ff->ph->env.clock.clockid = data32; in process_clock_data()
3054 ff->ph->env.clock.tod_ns = data64; in process_clock_data()
3060 ff->ph->env.clock.clockid_ns = data64; in process_clock_data()
3061 ff->ph->env.clock.enabled = true; in process_clock_data()
3091 ff->ph->env.nr_hybrid_nodes = nr; in process_hybrid_topology()
3092 ff->ph->env.hybrid_nodes = nodes; in process_hybrid_topology()
3111 session = container_of(ff->ph, struct perf_session, header); in process_dir_format()
3124 struct perf_env *env = &ff->ph->env; in process_bpf_prog_info()
3129 if (ff->ph->needs_swap) { in process_bpf_prog_info()
3192 struct perf_env *env = &ff->ph->env; in process_bpf_btf()
3197 if (ff->ph->needs_swap) { in process_bpf_btf()
3240 if (do_read_u32(ff, &(ff->ph->env.comp_ver))) in process_compressed()
3243 if (do_read_u32(ff, &(ff->ph->env.comp_type))) in process_compressed()
3246 if (do_read_u32(ff, &(ff->ph->env.comp_level))) in process_compressed()
3249 if (do_read_u32(ff, &(ff->ph->env.comp_ratio))) in process_compressed()
3252 if (do_read_u32(ff, &(ff->ph->env.comp_mmap_len))) in process_compressed()
3316 int ret = __process_pmu_caps(ff, &ff->ph->env.nr_cpu_pmu_caps, in process_cpu_pmu_caps()
3317 &ff->ph->env.cpu_pmu_caps, in process_cpu_pmu_caps()
3318 &ff->ph->env.max_branches); in process_cpu_pmu_caps()
3320 if (!ret && !ff->ph->env.cpu_pmu_caps) in process_cpu_pmu_caps()
3362 ff->ph->env.nr_pmus_with_caps = nr_pmu; in process_pmu_caps()
3363 ff->ph->env.pmu_caps = pmu_caps; in process_pmu_caps()
3451 struct perf_header *ph, in perf_file_section__fprintf_info() argument
3471 .ph = ph, in perf_file_section__fprintf_info()
3543 if (perf_header__has_feat(ff->ph, type)) { in do_write_feat()
3597 .ph = header, in perf_header__adds_write()
3784 struct perf_header *ph, in perf_header__process_sections() argument
3835 static int try_all_file_abis(uint64_t hdr_sz, struct perf_header *ph) in try_all_file_abis() argument
3848 ph->needs_swap = true; in try_all_file_abis()
3852 ph->needs_swap); in try_all_file_abis()
3873 static int try_all_pipe_abis(uint64_t hdr_sz, struct perf_header *ph) in try_all_pipe_abis() argument
3884 ph->needs_swap = true; in try_all_pipe_abis()
3903 bool is_pipe, struct perf_header *ph) in check_magic_endian() argument
3910 ph->version = PERF_HEADER_VERSION_1; in check_magic_endian()
3913 return try_all_pipe_abis(hdr_sz, ph); in check_magic_endian()
3915 return try_all_file_abis(hdr_sz, ph); in check_magic_endian()
3922 ph->version = PERF_HEADER_VERSION_2; in check_magic_endian()
3932 ph->needs_swap = true; in check_magic_endian()
3938 struct perf_header *ph, int fd) in perf_file_header__read() argument
3949 header->attr_size, false, ph) < 0) { in perf_file_header__read()
3954 if (ph->needs_swap) { in perf_file_header__read()
3965 } else if (ph->needs_swap) { in perf_file_header__read()
4000 memcpy(&ph->adds_features, &header->adds_features, in perf_file_header__read()
4001 sizeof(ph->adds_features)); in perf_file_header__read()
4003 ph->data_offset = header->data.offset; in perf_file_header__read()
4004 ph->data_size = header->data.size; in perf_file_header__read()
4005 ph->feat_offset = header->data.offset + header->data.size; in perf_file_header__read()
4010 struct perf_header *ph, in perf_file_section__process() argument
4015 .ph = ph, in perf_file_section__process()
4038 struct perf_header *ph, in perf_file_header__read_pipe() argument
4044 .ph = ph, in perf_file_header__read_pipe()
4052 if (check_magic_endian(header->magic, header->size, true, ph) < 0) { in perf_file_header__read_pipe()
4057 if (ph->needs_swap) in perf_file_header__read_pipe()
4080 static int read_attr(int fd, struct perf_header *ph, in read_attr() argument
4101 if (ph->needs_swap) in read_attr()
4320 ff.ph = &session->header; in perf_event__process_feature()