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_type_t` #111

Open valentin-seitz opened 3 months ago

valentin-seitz commented 3 months ago

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

Executing a code similar to:

#include <extrae.h>
#include <limits.h>
#include <stdio.h>
int main(){
        Extrae_init();
        extrae_value_t value = 1;
        extrae_type_t type=UINT_MAX-2; // type = 4294967293
        Extrae_event(type,value);

        extrae_value_t values[2]={0,value};
        char * descriptions[2] = {"zero","value"};
        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    4294967293    ownEventType
VALUES
0     zero
1     value

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

EVENT_TYPE
0    -3    ownEventType
VALUES
0      zero
1      value

Note, that this issue seems to happen before the merger, as the .sym file line corresponding to the generated .pcf entry is:

D -3 "ownEventType"
d 0 "zero"
d 1 "value"