linux-next: manual merge of the oprofile tree with the tip tree

From: Stephen Rothwell
Date: Tue Mar 13 2012 - 02:37:34 EST


Hi Robert,

Today's linux-next merge of the oprofile tree got a conflict in
tools/perf/util/header.c tools/perf/util/header.h between commit
330aa675b4f9 ("perf record: Add HEADER_BRANCH_STACK tag") from the tip
tree and commit c415f577eb32 ("perf tools: Add pmu mappings to header
information") from the oprofile tree.

Just context changes. I fixed it up (see below) and can carry the fix as
necessary.
--
Cheers,
Stephen Rothwell sfr@xxxxxxxxxxxxxxxx

diff --cc tools/perf/util/header.c
index 0d9b6da,626eb90..0000000
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@@ -1321,12 -1372,37 +1388,43 @@@ static void print_cpuid(struct perf_hea
free(str);
}

+static void print_branch_stack(struct perf_header *ph __used, int fd __used,
+ FILE *fp)
+{
+ fprintf(fp, "# contains samples with branch stack\n");
+}
+
+ static void print_pmu_mappings(struct perf_header *ph, int fd, FILE *fp)
+ {
+ const char *delimiter = "# pmu mappings: ";
+ char *name;
+ int ret;
+ u32 pmu_num;
+ u32 type;
+
+ ret = read(fd, &pmu_num, sizeof(pmu_num));
+ if (ret != sizeof(pmu_num))
+ goto error;
+
+ if (!pmu_num)
+ goto error;
+
+ while (pmu_num--) {
+ if (read(fd, &type, sizeof(type)) != sizeof(type))
+ goto error;
+ name = do_read_string(fd, ph);
+ fprintf(fp, "%s%s = %" PRIu32, delimiter, name, type);
+ free(name);
+ delimiter = ", ";
+ }
+
+ fprintf(fp, "\n");
+
+ return;
+ error:
+ fprintf(fp, "# pmu mappings: not available\n");
+ }
+
static int __event_process_build_id(struct build_id_event *bev,
char *filename,
struct perf_session *session)
@@@ -1531,7 -1607,7 +1629,8 @@@ static const struct feature_ops feat_op
FEAT_OPA(HEADER_CMDLINE, cmdline),
FEAT_OPF(HEADER_CPU_TOPOLOGY, cpu_topology),
FEAT_OPF(HEADER_NUMA_TOPOLOGY, numa_topology),
+ FEAT_OPA(HEADER_BRANCH_STACK, branch_stack),
+ FEAT_OPA(HEADER_PMU_MAPPINGS, pmu_mappings),
};

struct header_print_data {
diff --cc tools/perf/util/header.h
index 21a6be0,9b4d407..0000000
--- a/tools/perf/util/header.h
+++ b/tools/perf/util/header.h
@@@ -27,7 -27,8 +27,8 @@@ enum
HEADER_EVENT_DESC,
HEADER_CPU_TOPOLOGY,
HEADER_NUMA_TOPOLOGY,
+ HEADER_BRANCH_STACK,
+ HEADER_PMU_MAPPINGS,
-
HEADER_LAST_FEATURE,
HEADER_FEAT_BITS = 256,
};

Attachment: pgp00000.pgp
Description: PGP signature