|
@@ -23,6 +23,7 @@
|
|
#include "util/stat.h"
|
|
#include "util/stat.h"
|
|
#include <linux/bitmap.h>
|
|
#include <linux/bitmap.h>
|
|
#include "asm/bug.h"
|
|
#include "asm/bug.h"
|
|
|
|
+#include "util/mem-events.h"
|
|
|
|
|
|
static char const *script_name;
|
|
static char const *script_name;
|
|
static char const *generate_script_lang;
|
|
static char const *generate_script_lang;
|
|
@@ -649,6 +650,23 @@ static int perf_evlist__max_name_len(struct perf_evlist *evlist)
|
|
return max;
|
|
return max;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static size_t data_src__printf(u64 data_src)
|
|
|
|
+{
|
|
|
|
+ struct mem_info mi = { .data_src.val = data_src };
|
|
|
|
+ char decode[100];
|
|
|
|
+ char out[100];
|
|
|
|
+ static int maxlen;
|
|
|
|
+ int len;
|
|
|
|
+
|
|
|
|
+ perf_script__meminfo_scnprintf(decode, 100, &mi);
|
|
|
|
+
|
|
|
|
+ len = scnprintf(out, 100, "%16" PRIx64 " %s", data_src, decode);
|
|
|
|
+ if (maxlen < len)
|
|
|
|
+ maxlen = len;
|
|
|
|
+
|
|
|
|
+ return printf("%-*s", maxlen, out);
|
|
|
|
+}
|
|
|
|
+
|
|
static void process_event(struct perf_script *script, union perf_event *event,
|
|
static void process_event(struct perf_script *script, union perf_event *event,
|
|
struct perf_sample *sample, struct perf_evsel *evsel,
|
|
struct perf_sample *sample, struct perf_evsel *evsel,
|
|
struct addr_location *al)
|
|
struct addr_location *al)
|
|
@@ -689,7 +707,7 @@ static void process_event(struct perf_script *script, union perf_event *event,
|
|
print_sample_addr(event, sample, thread, attr);
|
|
print_sample_addr(event, sample, thread, attr);
|
|
|
|
|
|
if (PRINT_FIELD(DATA_SRC))
|
|
if (PRINT_FIELD(DATA_SRC))
|
|
- printf("%16" PRIx64, sample->data_src);
|
|
|
|
|
|
+ data_src__printf(sample->data_src);
|
|
|
|
|
|
if (PRINT_FIELD(WEIGHT))
|
|
if (PRINT_FIELD(WEIGHT))
|
|
printf("%16" PRIu64, sample->weight);
|
|
printf("%16" PRIu64, sample->weight);
|