Re: [PATCH 09/12] perf kvm: split out tracepoints from record args

From: Xiao Guangrong
Date: Wed Oct 17 2012 - 04:19:19 EST


On 10/09/2012 01:17 AM, David Ahern wrote:

> unsigned int rec_argc, i, j;
> const char **rec_argv;
> + const char * const record_args[] = {
> + "record",
> + "-R",
> + "-f",
> + "-m", "1024",
> + "-c", "1",
> + };
>
> - rec_argc = ARRAY_SIZE(record_args) + argc + 2;
> + rec_argc = ARRAY_SIZE(record_args) + argc + 2 +
> + ARRAY_SIZE(kvm_events_tp);

Only calculate the size of tracepoints...

> rec_argv = calloc(rec_argc + 1, sizeof(char *));
>
> if (rec_argv == NULL)
> @@ -818,6 +821,11 @@ static int kvm_events_record(struct perf_kvm *kvm, int argc, const char **argv)
> for (i = 0; i < ARRAY_SIZE(record_args); i++)
> rec_argv[i] = STRDUP_FAIL_EXIT(record_args[i]);
>
> + for (j = 0; j < ARRAY_SIZE(kvm_events_tp); j++) {
> + rec_argv[i++] = "-e";

Then you add "-e" into the array, however, it is calculated into rec_argc?
Or I missed something.

Other patches look good to me, thanks for your work and look forward to
the new version. :)

--
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/