@@ -1315,6 +1315,47 @@ struct sort_entry sort_mem_dcacheline = {
13151315 .se_width_idx = HISTC_MEM_DCACHELINE ,
13161316};
13171317
1318+ static int64_t
1319+ sort__phys_daddr_cmp (struct hist_entry * left , struct hist_entry * right )
1320+ {
1321+ uint64_t l = 0 , r = 0 ;
1322+
1323+ if (left -> mem_info )
1324+ l = left -> mem_info -> daddr .phys_addr ;
1325+ if (right -> mem_info )
1326+ r = right -> mem_info -> daddr .phys_addr ;
1327+
1328+ return (int64_t )(r - l );
1329+ }
1330+
1331+ static int hist_entry__phys_daddr_snprintf (struct hist_entry * he , char * bf ,
1332+ size_t size , unsigned int width )
1333+ {
1334+ uint64_t addr = 0 ;
1335+ size_t ret = 0 ;
1336+ size_t len = BITS_PER_LONG / 4 ;
1337+
1338+ addr = he -> mem_info -> daddr .phys_addr ;
1339+
1340+ ret += repsep_snprintf (bf + ret , size - ret , "[%c] " , he -> level );
1341+
1342+ ret += repsep_snprintf (bf + ret , size - ret , "%-#.*llx" , len , addr );
1343+
1344+ ret += repsep_snprintf (bf + ret , size - ret , "%-*s" , width - ret , "" );
1345+
1346+ if (ret > width )
1347+ bf [width ] = '\0' ;
1348+
1349+ return width ;
1350+ }
1351+
1352+ struct sort_entry sort_mem_phys_daddr = {
1353+ .se_header = "Data Physical Address" ,
1354+ .se_cmp = sort__phys_daddr_cmp ,
1355+ .se_snprintf = hist_entry__phys_daddr_snprintf ,
1356+ .se_width_idx = HISTC_MEM_PHYS_DADDR ,
1357+ };
1358+
13181359static int64_t
13191360sort__abort_cmp (struct hist_entry * left , struct hist_entry * right )
13201361{
@@ -1547,6 +1588,7 @@ static struct sort_dimension memory_sort_dimensions[] = {
15471588 DIM (SORT_MEM_LVL , "mem" , sort_mem_lvl ),
15481589 DIM (SORT_MEM_SNOOP , "snoop" , sort_mem_snoop ),
15491590 DIM (SORT_MEM_DCACHELINE , "dcacheline" , sort_mem_dcacheline ),
1591+ DIM (SORT_MEM_PHYS_DADDR , "phys_daddr" , sort_mem_phys_daddr ),
15501592};
15511593
15521594#undef DIM
0 commit comments