Commit d3e7cad
committed
perf annotate: Add a hashmap for symbol histogram
Now symbol histogram uses an array to save per-offset sample counts.
But it wastes a lot of memory if the symbol has a few samples only.
Add a hashmap to save values only for actual samples.
For now, it has duplicate histogram (one in the existing array and
another in the new hash map). Once it can convert to use the hash
in all places, we can get rid of the array later.
Reviewed-by: Ian Rogers <irogers@google.com>
Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240304230815.1440583-2-namhyung@kernel.org1 parent 7bfc84b commit d3e7cad
2 files changed
Lines changed: 42 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
863 | 864 | | |
864 | 865 | | |
865 | 866 | | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
866 | 878 | | |
867 | 879 | | |
868 | 880 | | |
| |||
877 | 889 | | |
878 | 890 | | |
879 | 891 | | |
| 892 | + | |
| 893 | + | |
880 | 894 | | |
881 | 895 | | |
882 | 896 | | |
| |||
909 | 923 | | |
910 | 924 | | |
911 | 925 | | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
912 | 934 | | |
913 | 935 | | |
914 | 936 | | |
| |||
920 | 942 | | |
921 | 943 | | |
922 | 944 | | |
| 945 | + | |
923 | 946 | | |
924 | 947 | | |
925 | 948 | | |
| |||
983 | 1006 | | |
984 | 1007 | | |
985 | 1008 | | |
986 | | - | |
| 1009 | + | |
| 1010 | + | |
987 | 1011 | | |
| 1012 | + | |
988 | 1013 | | |
989 | 1014 | | |
990 | 1015 | | |
| |||
1002 | 1027 | | |
1003 | 1028 | | |
1004 | 1029 | | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
1005 | 1041 | | |
1006 | 1042 | | |
1007 | 1043 | | |
1008 | 1044 | | |
| 1045 | + | |
| 1046 | + | |
1009 | 1047 | | |
1010 | 1048 | | |
1011 | 1049 | | |
1012 | 1050 | | |
1013 | | - | |
| 1051 | + | |
1014 | 1052 | | |
1015 | 1053 | | |
1016 | 1054 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
280 | 281 | | |
281 | 282 | | |
282 | 283 | | |
| 284 | + | |
283 | 285 | | |
284 | 286 | | |
285 | 287 | | |
| |||
0 commit comments