Extract map_pgoff parameter from the dictionary, and adjust start/end range passed to objdump based on the value. A zero start_addr is filtered to prevent output of dso address range check failures. This script repeatedly sees a zero value passed in for start_addr = cpu_data[str(cpu) + 'addr'] These zero values are not a new problem. The start_addr/stop_addr warning clutters the instruction trace output, hence this change.
Unified · Split
| @@ -793,7 +793,8 @@ static int set_regs_in_dict(PyObject *dict, · 792 unmodified lines | ||
| 793 | 793 | static void set_sym_in_dict(PyObject *dict, struct addr_location *al, |
| 794 | 794 | const char *dso_field, const char *dso_bid_field, |
| 795 | 795 | const char *dso_map_start, const char *dso_map_end, |
| 796 | − const char *sym_field, const char *symoff_field) | |
| 796 | + const char *sym_field, const char *symoff_field, | |
| 797 | + const char *map_pgoff) | |
| 797 | 798 | { |
| 798 | 799 | char sbuild_id[SBUILD_ID_SIZE]; |
| 799 | 800 | |
| @@ -809,6 +810,8 @@ static void set_sym_in_dict(PyObject *dict, struct addr_location *al, · 9 unmodified lines | ||
| 809 | 810 | PyLong_FromUnsignedLong(map__start(al->map))); |
| 810 | 811 | pydict_set_item_string_decref(dict, dso_map_end, |
| 811 | 812 | PyLong_FromUnsignedLong(map__end(al->map))); |
| 813 | + pydict_set_item_string_decref(dict, map_pgoff, | |
| 814 | + PyLong_FromUnsignedLongLong(map__pgoff(al->map))); | |
| 812 | 815 | } |
| 813 | 816 | if (al->sym) { |
| 814 | 817 | pydict_set_item_string_decref(dict, sym_field, |
| @@ -895,7 +898,7 @@ static PyObject *get_perf_sample_dict(struct perf_sample *sample, · 80 unmodified lines | ||
| 895 | 898 | pydict_set_item_string_decref(dict, "comm", |
| 896 | 899 | _PyUnicode_FromString(thread__comm_str(al->thread))); |
| 897 | 900 | set_sym_in_dict(dict, al, "dso", "dso_bid", "dso_map_start", "dso_map_end", |
| 898 | − "symbol", "symoff"); | |
| 901 | + "symbol", "symoff", "map_pgoff"); | |
| 899 | 902 | |
| 900 | 903 | pydict_set_item_string_decref(dict, "callchain", callchain); |
| 901 | 904 | |
| @@ -920,7 +923,7 @@ static PyObject *get_perf_sample_dict(struct perf_sample *sample, · 18 unmodified lines | ||
| 920 | 923 | PyBool_FromLong(1)); |
| 921 | 924 | set_sym_in_dict(dict_sample, addr_al, "addr_dso", "addr_dso_bid", |
| 922 | 925 | "addr_dso_map_start", "addr_dso_map_end", |
| 923 | − "addr_symbol", "addr_symoff"); | |
| 926 | + "addr_symbol", "addr_symoff", "addr_map_pgoff"); | |
| 924 | 927 | } |
| 925 | 928 | |
| 926 | 929 | if (sample->flags) |