[PATCH] record: Add support for interrupt handlers

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Sep 5 04:42:31 UTC 2019


----- Am 5. Sep 2019 um 0:28 schrieb Chris Johns chrisj at rtems.org:

> On 4/9/19 9:46 pm, Sebastian Huber wrote:
>> On 04/09/2019 08:06, Chris Johns wrote:
>>>> +void LTTNGClient::WriteIRQHandlerExit(PerCPUContext* pcpu, const ClientItem&
>>>> item) {
>>>> +  pcpu->content_size += kEventIRQHandlerExitBits;
>>>> +  pcpu->packet_size += kEventIRQHandlerExitBits;
>>>> +
>>>> +  EventIRQHandlerExit& ih = pcpu->irq_handler_exit;
>>>> +  ih.header.ns = item.ns;
>>>> +  ih.irq = static_cast<int32_t>(item.data);
>>>> +  fwrite(&ih, sizeof(ih), 1, pcpu->event_stream);
>>> https://en.cppreference.com/w/cpp/io  :)
>> 
>> I had a look a this, it seems the error reporting capabilities of <fstream> are
>> quite bad (nothing like strerror(errno)).
> 
> Interesting point to make given the return code from `fwrite` is not checked. :)

Yes, but at least the return status of fopen() is checked.

> Also it should be `std::fwrite`.

Ok, it seems <stdio.h> was included via <iostream>. I will fix this.


More information about the devel mailing list