RE: [PATCH v10 08/10] btrace, linux: Enable ptwrite packets.

Metzger, Markus T via Gdb-patches
2023-08-08T10:13:40Z

Hello Felix,

>> >+#if (LIBIPT_VERSION >= 0x200)
>> >+ record_btrace_conf.pt.ptwrite = true;
>> >+#else
>> >+ record_btrace_conf.pt.ptwrite = false;
>> >+#endif
>>
>> Is there a way to get an error when attempting to install a custom
>> ptwrite filter when either GDB (via libipt) or the kernel does not
>> support PTWRITE?
>
>Good point. Unfortunately I don't see one with the current design.
>Currently we just cache the filter functions in python when one is
>registered. The configuration isn't exposed to the python layer in
>any way.
>
>I am not sure how we could do this. Exposing "maint btrace info"
>and parsing that would be one way, not sure if we want to go down
>that path.

We could warn at decode-time when applying the ptwrite filter.
We should have different warning texts for GDB (via libipt) not
supporting ptwrite and the system (kernel or h/w) not supporting it.

Not as good as an error when installing the ptwrite filter but better
than wondering why it isn't working as expected.

Regards,
Markus.