> Since debugging isn't time critical it might be necessary to add an additional > step that scans tracing messages for newline characters, then massaging the > output by inserting the time stamp. In other words, all occurrences of > > `\n` > > should be replaced with > > `\n[time stamp] ` > > or something similar.
This would print wrong-ish timestamps that couldn't really be used for profiling (I mean, it could; you just have to know which timestamp belongs to which message). I would suggest to rather store a flag after reading `\n` and attach the timestamp to the following message. Also, I would believe that `fmt[strlen(fmt) - 1] == '\n'` is rather fast, esp. given that this is followed by an IO operation. To be tested though :) Writing this lead me to look for multi-linebreak traces (e.g. src/pcf/pfcread.c:504) -- should that have one timestamp for the entire statement or one timestamp per line? Armin