Re: [PATCH v17 14/18] trace-cmd: Add host trace clock as guest trace argument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 11 Dec 2019 10:21:44 +0200
Tzvetomir Stoyanov <tz.stoyanov@xxxxxxxxx> wrote:

> In case of a guest ("-A" option), the logic skips the switch(), so the
> guest args are not parsed.
> There is a check, right before the switch() :

Ah, thanks, I forgot about that.


> 
>         /*
>          * If the current instance is to record a guest, then save
>          * all the arguments for this instance.
>          */
>         if (c != 'B' && c != 'A' && is_guest(ctx->instance)) {
>             add_arg(ctx->instance, c, opts, long_options, optarg);
>             continue;
>         }
> 
> I can put inside that if() a check for "-C" guest argument, but it
> will look like a hack.

I disagree. It's no more of a "hack" than appending a "-C" to the
arguments. I think it's the right solution. We can simply add:

	if (c == 'C')
		ctx->instance->flags |= BUFFER_FL_HAS_CLOCK;

Then we could test if that flag is set for the instance below.

-- Steve

> 
> The confusion is that guest_config is set to true for any "-C" host argument,
> including those for instances, but only the one from the top instance
> is used to inject
> guest clock arg.
> 
> 
> > -- Steve
> >
> >                                 if (is_guest(instance)) {
> >                                         add_argv(instance,
> >                                                  (char *)top_instance.ftrace->clock,
> >                                                  true);
> >                                         add_argv(instance, "-C", true);
> >                                 }
> >                         }
> >                 }
> >         }  
> 
> 
> 




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux