Re: [PATCH 3/8] perf data: Add perf data to CTF conversion support
From: Namhyung Kim
Date: Mon Dec 08 2014 - 03:13:49 EST
On Thu, Dec 4, 2014 at 1:23 AM, Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index 33864dd316e5..2d3229ec0a23 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -402,6 +402,10 @@ LIB_OBJS += $(OUTPUT)util/tsc.o
> LIB_OBJS += $(OUTPUT)util/cloexec.o
> LIB_OBJS += $(OUTPUT)util/thread-stack.o
>
> +ifneq ($(NO_LIBBABELTRACE),1)
I think we usually do it with just "ifndef".
> +LIB_OBJS += $(OUTPUT)util/data-convert-bt.o
> +endif
> +
> LIB_OBJS += $(OUTPUT)ui/setup.o
> LIB_OBJS += $(OUTPUT)ui/helpline.o
> LIB_OBJS += $(OUTPUT)ui/progress.o
[SNIP]
> +static int add_generic_values(struct ctf_writer *cw,
> + struct bt_ctf_event *event,
> + struct perf_evsel *evsel,
> + struct perf_sample *sample)
> +{
> + u64 type = evsel->attr.sample_type;
> + int ret;
> +
> + /*
> + * missing:
> + * PERF_SAMPLE_TIME - not needed as we have it in
> + * ctf event header
> + * PERF_SAMPLE_READ - TODO
> + * PERF_SAMPLE_CALLCHAIN - TODO
> + * PERF_SAMPLE_RAW - tracepoint fields are handled separately
> + * PERF_SAMPLE_BRANCH_STACK - TODO
> + * PERF_SAMPLE_REGS_USER - TODO
> + * PERF_SAMPLE_STACK_USER - TODO
> + */
> +
> + if (type & PERF_SAMPLE_IP) {
> + ret = value_set_u64_hex(cw, event, "ip", sample->ip);
> + if (ret)
> + return -1;
> + }
> +
> + if (type & PERF_SAMPLE_TID) {
> + ret = value_set_s32(cw, event, "tid", sample->tid);
> + if (ret)
> + return -1;
> +
> + ret = value_set_s32(cw, event, "pid", sample->tid);
sample->pid ?
> + if (ret)
> + return -1;
> + }
> +
> + if ((type & PERF_SAMPLE_ID) ||
> + (type & PERF_SAMPLE_IDENTIFIER)) {
> + ret = value_set_u64(cw, event, "id", sample->id);
> + if (ret)
> + return -1;
> + }
> +
> + if (type & PERF_SAMPLE_STREAM_ID) {
> + ret = value_set_u64(cw, event, "stream_id", sample->id);
sample->stream_id ?
Thanks,
Namhyung
> + if (ret)
> + return -1;
> + }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/