[PATCH] record: Add support for interrupt handlers

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Sep 4 07:37:00 UTC 2019


On 04/09/2019 08:44, Chris Johns wrote:
> On 4/9/19 4:27 pm, Sebastian Huber wrote:
>> On 04/09/2019 08:06, Chris Johns wrote:
>>>> +}
>>>> +
>>>>    void LTTNGClient::AddThreadName(PerCPUContext* pcpu, const ClientItem& item) {
>>>>      if (pcpu->thread_name_index >= THREAD_NAME_SIZE) {
>>>>        return;
>>>> @@ -286,6 +339,12 @@ void LTTNGClient::PrintItem(const ClientItem& item) {
>>>>          pcpu.thread_ns = item.ns;
>>>>          pcpu.thread_name_index = 0;
>>>>          break;
>>>> +    case RTEMS_RECORD_INTERRUPT_ENTRY:
>>>> +      WriteIRQHandlerEntry(&pcpu, item);
>>>> +      break;
>>>> +    case RTEMS_RECORD_INTERRUPT_EXIT:
>>>> +      WriteIRQHandlerExit(&pcpu, item);
>>> ... then take the address of? I prefer to see references being used where
>>> possible.
>> This is the Google style:
>>
>> https://google.github.io/styleguide/cppguide.html#Reference_Arguments
>>
>> I think it makes sense. You see right at the calling place, that a parameter may
>> be modified.
> I do not agree, they forgot to discuss the help the compiler gives you and so I
> will not adopt it. The Con has "... as they have value syntax but pointer
> semantics" which is being little simplistic. I could go on but will not it is
> style and may be related to a large existing code base and that may carry real
> weight.

I am not a Google C++ Style Guide expert. I guess this rule is somehow 
related to one of the primary goals of the guide:

https://google.github.io/styleguide/cppguide.html#Goals

"Optimize for the reader, not the writer"

The reader here is not the compiler.

It is fine, if you don't like this rule. We don't have to follow this 
guide in very aspect. I just would like to have some common place 
default rule set (e.g. the Google C++ Style Guide) and it should be 
allowed to follow the rules.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list