Commit a3880fd2 authored by François Trahay's avatar François Trahay
Browse files

OTF: fix the processing of counters. This fixes a bug that prevents vite from...

OTF: fix the processing of counters. This fixes a bug that prevents vite from displaying properly traces with multiple counters
parent 653b0a71
...@@ -528,14 +528,14 @@ int ParserEventOTF::handler_Counter( void* userData, ...@@ -528,14 +528,14 @@ int ParserEventOTF::handler_Counter( void* userData,
Container *temp_container = NULL; Container *temp_container = NULL;
map<string, Value *> extra_fields; map<string, Value *> extra_fields;
String counter_group_name = String(temp_counter_group._name); String counter_name = String(temp_counter._name);
VariableType *temp_variable_type = t->search_variable_type(counter_group_name); VariableType *temp_variable_type = t->search_variable_type(counter_name);
ProcessGroup process_group = ParserDefinitionOTF::get_processgroup_by_process(proc_id); ProcessGroup process_group = ParserDefinitionOTF::get_processgroup_by_process(proc_id);
ContainerType *temp_container_type = t->search_container_type(String(process_group._name)); ContainerType *temp_container_type = t->search_container_type(String(process_group._name));
const String temp_proc_name = String(temp_proc._name); const String temp_proc_name = String(temp_proc._name);
if(_containers.find(temp_proc_name) != _containers.end()) { if(_containers.find(temp_proc_name) != _containers.end()) {
temp_container = _containers[temp_proc_name]; temp_container = _containers[temp_proc_name];
} }
...@@ -545,9 +545,10 @@ int ParserEventOTF::handler_Counter( void* userData, ...@@ -545,9 +545,10 @@ int ParserEventOTF::handler_Counter( void* userData,
} }
if(temp_variable_type == 0) { if(temp_variable_type == 0) {
Name name_temp(temp_counter_group._name, ""); // cannot find this counter. Define it.
Name name_temp(counter_name);
t->define_variable_type(name_temp, temp_container_type, extra_fields); t->define_variable_type(name_temp, temp_container_type, extra_fields);
temp_variable_type = t->search_variable_type(counter_group_name); temp_variable_type = t->search_variable_type(counter_name);
} }
if(temp_container == NULL && temp_proc._name != "0") { if(temp_container == NULL && temp_proc._name != "0") {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment