Lines Matching refs:ph

235 	if (ff->ph->needs_swap)  in do_read_u32()
248 if (ff->ph->needs_swap) in do_read_u64()
325 session = container_of(ff->ph, struct perf_session, header); in write_build_id()
560 struct perf_env *env = &ff->ph->env; in write_cmdline()
590 struct perf_env *env = &ff->ph->env; in write_cpu_topology()
916 session = container_of(ff->ph, struct perf_session, header); in write_auxtrace()
927 return do_write(ff, &ff->ph->env.clock.clockid_res_ns, in write_clockid()
928 sizeof(ff->ph->env.clock.clockid_res_ns)); in write_clockid()
946 data32 = ff->ph->env.clock.clockid; in write_clock_data()
953 data64 = &ff->ph->env.clock.tod_ns; in write_clock_data()
960 data64 = &ff->ph->env.clock.clockid_ns; in write_clock_data()
1005 session = container_of(ff->ph, struct perf_session, header); in write_dir_format()
1018 struct perf_env *env = &ff->ph->env; in write_bpf_prog_info()
1063 struct perf_env *env = &ff->ph->env; in write_bpf_btf()
1513 ret = do_write(ff, &(ff->ph->env.comp_ver), sizeof(ff->ph->env.comp_ver)); in write_compressed()
1517 ret = do_write(ff, &(ff->ph->env.comp_type), sizeof(ff->ph->env.comp_type)); in write_compressed()
1521 ret = do_write(ff, &(ff->ph->env.comp_level), sizeof(ff->ph->env.comp_level)); in write_compressed()
1525 ret = do_write(ff, &(ff->ph->env.comp_ratio), sizeof(ff->ph->env.comp_ratio)); in write_compressed()
1529 return do_write(ff, &(ff->ph->env.comp_mmap_len), sizeof(ff->ph->env.comp_mmap_len)); in write_compressed()
1626 fprintf(fp, "# hostname : %s\n", ff->ph->env.hostname); in print_hostname()
1631 fprintf(fp, "# os release : %s\n", ff->ph->env.os_release); in print_osrelease()
1636 fprintf(fp, "# arch : %s\n", ff->ph->env.arch); in print_arch()
1641 fprintf(fp, "# cpudesc : %s\n", ff->ph->env.cpu_desc); in print_cpudesc()
1646 fprintf(fp, "# nrcpus online : %u\n", ff->ph->env.nr_cpus_online); in print_nrcpus()
1647 fprintf(fp, "# nrcpus avail : %u\n", ff->ph->env.nr_cpus_avail); in print_nrcpus()
1652 fprintf(fp, "# perf version : %s\n", ff->ph->env.version); in print_version()
1659 nr = ff->ph->env.nr_cmdline; in print_cmdline()
1664 char *argv_i = strdup(ff->ph->env.cmdline_argv[i]); in print_cmdline()
1666 fprintf(fp, "%s ", ff->ph->env.cmdline_argv[i]); in print_cmdline()
1686 struct perf_header *ph = ff->ph; in print_cpu_topology() local
1687 int cpu_nr = ph->env.nr_cpus_avail; in print_cpu_topology()
1691 nr = ph->env.nr_sibling_cores; in print_cpu_topology()
1692 str = ph->env.sibling_cores; in print_cpu_topology()
1699 if (ph->env.nr_sibling_dies) { in print_cpu_topology()
1700 nr = ph->env.nr_sibling_dies; in print_cpu_topology()
1701 str = ph->env.sibling_dies; in print_cpu_topology()
1709 nr = ph->env.nr_sibling_threads; in print_cpu_topology()
1710 str = ph->env.sibling_threads; in print_cpu_topology()
1717 if (ph->env.nr_sibling_dies) { in print_cpu_topology()
1718 if (ph->env.cpu != NULL) { in print_cpu_topology()
1722 i, ph->env.cpu[i].core_id, in print_cpu_topology()
1723 ph->env.cpu[i].die_id, in print_cpu_topology()
1724 ph->env.cpu[i].socket_id); in print_cpu_topology()
1729 if (ph->env.cpu != NULL) { in print_cpu_topology()
1733 i, ph->env.cpu[i].core_id, in print_cpu_topology()
1734 ph->env.cpu[i].socket_id); in print_cpu_topology()
1744 ff->ph->env.clock.clockid_res_ns * 1000); in print_clockid()
1756 if (!ff->ph->env.clock.enabled) { in print_clock_data()
1762 ref = ff->ph->env.clock.tod_ns; in print_clock_data()
1768 ref = ff->ph->env.clock.clockid_ns; in print_clock_data()
1773 clockid = ff->ph->env.clock.clockid; in print_clock_data()
1796 for (i = 0; i < ff->ph->env.nr_hybrid_nodes; i++) { in print_hybrid_topology()
1797 n = &ff->ph->env.hybrid_nodes[i]; in print_hybrid_topology()
1807 session = container_of(ff->ph, struct perf_session, header); in print_dir_format()
1816 struct perf_env *env = &ff->ph->env; in print_bpf_prog_info()
1843 struct perf_env *env = &ff->ph->env; in print_bpf_btf()
1955 if (ff->ph->needs_swap) in read_event_desc()
1966 if (ff->ph->needs_swap) in read_event_desc()
2043 fprintf(fp, "# total memory : %llu kB\n", ff->ph->env.total_mem); in print_total_mem()
2051 for (i = 0; i < ff->ph->env.nr_numa_nodes; i++) { in print_numa_topology()
2052 n = &ff->ph->env.numa_nodes[i]; in print_numa_topology()
2065 fprintf(fp, "# cpuid : %s\n", ff->ph->env.cpuid); in print_cpuid()
2088 for (i = 0; i < ff->ph->env.caches_cnt; i++) { in print_cache()
2090 cpu_cache_level__fprintf(fp, &ff->ph->env.caches[i]); in print_cache()
2097 ff->ph->env.comp_type == PERF_COMP_ZSTD ? "Zstd" : "Unknown", in print_compressed()
2098 ff->ph->env.comp_level, ff->ph->env.comp_ratio); in print_compressed()
2122 __print_pmu_caps(fp, ff->ph->env.nr_cpu_pmu_caps, in print_cpu_pmu_caps()
2123 ff->ph->env.cpu_pmu_caps, (char *)"cpu"); in print_cpu_pmu_caps()
2128 struct perf_env *env = &ff->ph->env; in print_pmu_caps()
2148 struct perf_env *env = &ff->ph->env; in print_pmu_mappings()
2189 session = container_of(ff->ph, struct perf_session, header); in print_group_desc()
2211 session = container_of(ff->ph, struct perf_session, header); in print_sample_time()
2242 struct perf_env *env = &ff->ph->env; in print_mem_topology()
2421 free(ff->ph->env.__feat_env); \
2422 ff->ph->env.__feat_env = do_read_string(ff); \
2423 return ff->ph->env.__feat_env ? 0 : -ENOMEM; \
2444 if (perf_header__read_build_ids(ff->ph, ff->fd, ff->offset, ff->size)) in process_build_id()
2451 struct perf_env *env = &ff->ph->env; in process_nrcpus()
2469 struct perf_env *env = &ff->ph->env; in process_total_mem()
2518 session = container_of(ff->ph, struct perf_session, header); in process_event_desc()
2537 struct perf_env *env = &ff->ph->env; in process_cmdline()
2579 struct perf_env *env = &ff->ph->env; in process_cpu_topology()
2695 struct perf_env *env = &ff->ph->env; in process_numa_topology()
2741 struct perf_env *env = &ff->ph->env; in process_pmu_mappings()
2791 struct perf_env *env = &ff->ph->env; in process_group_desc()
2830 session = container_of(ff->ph, struct perf_session, header); in process_group_desc()
2878 session = container_of(ff->ph, struct perf_session, header); in process_auxtrace()
2881 ff->ph->needs_swap); in process_auxtrace()
2889 struct perf_env *env = &ff->ph->env; in process_cache()
2949 session = container_of(ff->ph, struct perf_session, header); in process_sample_time()
2967 struct perf_env *env = &ff->ph->env; in process_mem_topology()
3020 struct perf_env *env = &ff->ph->env; in process_clockid()
3031 struct perf_env *env = &ff->ph->env; in process_clock_data()
3066 struct perf_env *env = &ff->ph->env; in process_hybrid_topology()
3110 session = container_of(ff->ph, struct perf_session, header); in process_dir_format()
3123 struct perf_env *env = &ff->ph->env; in process_bpf_prog_info()
3128 if (ff->ph->needs_swap) { in process_bpf_prog_info()
3195 struct perf_env *env = &ff->ph->env; in process_bpf_btf()
3200 if (ff->ph->needs_swap) { in process_bpf_btf()
3244 struct perf_env *env = &ff->ph->env; in process_compressed()
3330 struct perf_env *env = &ff->ph->env; in process_cpu_pmu_caps()
3344 struct perf_env *env = &ff->ph->env; in process_pmu_caps()
3471 struct perf_header *ph, in perf_file_section__fprintf_info() argument
3491 .ph = ph, in perf_file_section__fprintf_info()
3563 if (perf_header__has_feat(ff->ph, type)) { in do_write_feat()
3610 .ph = header, in perf_header__adds_write()
3681 .ph = header, in perf_session__do_write_header()
3839 struct perf_header *ph, in perf_header__process_sections() argument
3890 static int try_all_file_abis(uint64_t hdr_sz, struct perf_header *ph) in try_all_file_abis() argument
3903 ph->needs_swap = true; in try_all_file_abis()
3907 ph->needs_swap); in try_all_file_abis()
3928 static int try_all_pipe_abis(uint64_t hdr_sz, struct perf_header *ph) in try_all_pipe_abis() argument
3939 ph->needs_swap = true; in try_all_pipe_abis()
3958 bool is_pipe, struct perf_header *ph) in check_magic_endian() argument
3965 ph->version = PERF_HEADER_VERSION_1; in check_magic_endian()
3968 return try_all_pipe_abis(hdr_sz, ph); in check_magic_endian()
3970 return try_all_file_abis(hdr_sz, ph); in check_magic_endian()
3977 ph->version = PERF_HEADER_VERSION_2; in check_magic_endian()
3987 ph->needs_swap = true; in check_magic_endian()
3993 struct perf_header *ph, int fd) in perf_file_header__read() argument
4004 header->attr_size, false, ph) < 0) { in perf_file_header__read()
4009 if (ph->needs_swap) { in perf_file_header__read()
4038 } else if (ph->needs_swap) { in perf_file_header__read()
4073 memcpy(&ph->adds_features, &header->adds_features, in perf_file_header__read()
4074 sizeof(ph->adds_features)); in perf_file_header__read()
4076 ph->data_offset = header->data.offset; in perf_file_header__read()
4077 ph->data_size = header->data.size; in perf_file_header__read()
4078 ph->feat_offset = header->data.offset + header->data.size; in perf_file_header__read()
4083 struct perf_header *ph, in perf_file_section__process() argument
4088 .ph = ph, in perf_file_section__process()
4111 struct perf_header *ph, in perf_file_header__read_pipe() argument
4120 if (check_magic_endian(header->magic, header->size, true, ph) < 0) { in perf_file_header__read_pipe()
4125 if (ph->needs_swap) in perf_file_header__read_pipe()
4144 static int read_attr(int fd, struct perf_header *ph, in read_attr() argument
4165 if (ph->needs_swap) in read_attr()
4381 ff.ph = &session->header; in perf_event__process_feature()