bsc-performance-tools / extrae

Instrumentation framework to generate execution traces of the most used parallel runtimes.
https://tools.bsc.es/extrae
GNU Lesser General Public License v2.1
62 stars 38 forks source link

`Extrae_define_event_type` does not honor value range of `extrae_value_t` #110

Open valentin-seitz opened 3 months ago

valentin-seitz commented 3 months ago

According to the extrae_types.h the extrae_value_t is defined as: typedef unsigned long long extrae_value_t;

Executing a code similar to:

#include <extrae.h>
#include <limits.h>
#include <stdio.h>
int main(){
        Extrae_init();
        extrae_value_t value = ULLONG_MAX -1; // ULLONG_MAX -1 = 18446744073709551614
        extrae_type_t type=1000;
        printf("Extrae Value: %llu", value);
        Extrae_event(type,value);

        extrae_value_t values[2]={0,value};
        char * descriptions[2] = {"zero","max_value-1"};
        unsigned nValues=2;
        Extrae_define_event_type (&type,"ownEventType",&nValues, values, descriptions);
}

I would expect the output in the corresponding .pcf file to contain:

EVENT_TYPE
0    1000    ownEventType
VALUES
0      zero
18446744073709551614     max_value-1

But using the current version of Extrae (v.4.1.7) I get the following output:

EVENT_TYPE
0    1000    ownEventType
VALUES
0      zero
-1      max_value-1

Where the extrae_value_t seems to overflow, probably because of a cast happening in the merger, as the .sym files still shows the correct entry.

This issue was also reported via email, but I will put here as well as other users might also encounter a similar problem down the line.