- if (rctx->output_sort) {
- xbt_dynar_t a = xbt_str_split(rctx->output_got->data, "\n");
- xbt_dynar_sort(a,cmpstringp);
- char *sorted_output = xbt_str_join(a, "\n");
- strcpy(rctx->output_got->data, sorted_output);
- xbt_free(sorted_output);
- xbt_dynar_free(&a);
- /* If an empty line moved in first position, move it back to the end */
- if (rctx->output_got->data[0]=='\n') {
- memmove(rctx->output_got->data,rctx->output_got->data+1,rctx->output_got->used-1);
- rctx->output_got->data[rctx->output_got->used-1] = '\n';
- }
- }
+ if(rctx->output_sort || coverage){
+ xbt_dynar_t a = xbt_str_split(rctx->output_got->data, "\n");
+
+ if (rctx->output_sort)
+ xbt_dynar_sort(a,cmpstringp);
+
+ if (coverage){
+ char * ligne;
+ unsigned int cpt;
+
+ xbt_dynar_foreach(a, cpt, ligne) {
+ if(!strncmp(ligne,"profiling:",strlen("profiling:"))){
+ XBT_DEBUG("Remove line '%s'",ligne);
+ rctx->output_got->used -= strlen(ligne)+1;
+ xbt_dynar_cursor_rm(a,&cpt);
+ }
+ }
+ }
+
+ char *sorted_output = xbt_str_join(a, "\n");
+ strcpy(rctx->output_got->data, sorted_output);
+ xbt_free(sorted_output);
+ xbt_dynar_free(&a);
+
+ /* If an empty line moved in first position, move it back to the end */
+ if (rctx->output_got->data[0]=='\n') {
+ memmove(rctx->output_got->data,rctx->output_got->data+1,rctx->output_got->used-1);
+ rctx->output_got->data[rctx->output_got->used-1] = '\n';
+ }
+ }
+