Skip to content

Conversation

@firewave
Copy link
Collaborator

@firewave firewave commented Mar 8, 2023

This is a step onto leveraging the ThreadExecutor implementation for ProcessExecutor which is a follow-up to #4870. We need to have the proper test coverage and the existing implementations working as expected before we move to the shared code.

Fixes:

  • added --showtime= tests for all executor implementations
  • only print --showtime=summary once at the end
  • prevents --showtime= by multiple threads to be written at the same time - essentially breaking the output
  • reset the timer results before each test
  • deprecated top5 in favor of top5_file
  • fixed printing for all executors except ProcessExecutor

" --rule-file=<file> Use given rule file. For more information, see:\n"
" http://sourceforge.net/projects/cppcheck/files/Articles/\n"
#endif
// TODO: document --showtime
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add after it is well defined after all my other comments/TODOs have been resolved.

check(2, 3, 3, oss.str());
}

// TODO: check the output
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a thread-safe REDIRECT - will take some time to address this.


// TODO: provide data which actually shows values above 0

// TODO: should this be logged only once like summary?
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think top5 makes sense in the summary and file context.

So I suggested we add top5_file and top5_summary and deprecate top5. We could keep top5 but it currently behaves like top5_file so that might be confusing.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@firewave
Copy link
Collaborator Author

firewave commented Mar 8, 2023

@danmar I need some feedback on my comments to finish this up and move it out of draft. Thanks.

}
}

// TODO: this does not include any file context when SHOWTIME_FILE thus rendering it useless - should we include the logging with the progress logging?
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would also be without context when using -q so tacking it with the progress won't help there and we need to add some kind of header.

@firewave firewave force-pushed the showtime branch 2 times, most recently from 840b39c to 9970e3a Compare March 10, 2023 08:30
@firewave firewave marked this pull request as draft March 20, 2023 19:02
@firewave
Copy link
Collaborator Author

Requires #4963 to be merged first.

@firewave
Copy link
Collaborator Author

firewave commented May 4, 2023

The TSAN error with --showtime=file was always present we just never ran with that option in a TSAN context.

The locking for std::cout in timer.cpp needs to be replaced with using ErrorLogger::reportOut() which is properly synchronized when using multiple threads. I will address that in a future PR. I am still working on untangling all those existing error loggers.

@firewave firewave marked this pull request as ready for review May 4, 2023 16:15
@firewave firewave marked this pull request as draft May 4, 2023 17:08
@firewave firewave force-pushed the showtime branch 4 times, most recently from da6dc5c to 6215566 Compare September 26, 2023 20:41
@firewave
Copy link
Collaborator Author

Everything should be fixed except for the ProcessExecutor implementation. As noted above I will be tackling that in a different PR.

@firewave firewave force-pushed the showtime branch 2 times, most recently from 795c823 to 223a138 Compare September 27, 2023 08:06
@firewave firewave changed the title refs #4452 - improved --showtime= behavior and testing refs #4452 / refs #11705 - improved --showtime= behavior and testing Sep 27, 2023
@firewave
Copy link
Collaborator Author

Some notes for the initial comment which should not be part of the commit message and might even be a bit outdated.

Notes:

  • the process implementation is currently broken and I have not applied fixes to it yet - it will be implicitly fixed when it leverages the thread implementation (PR coming soon)
  • --showtime= output might still be mixed up with the regular output from another thread. we also need to pipe the regular output through the SyncLogForwarder. this is only an issue with --showtime=. this will be fixed after the implementations are shared - possibly starting the verbose/stray std::cout usage cleanup - I have no idea how to address this yet.
  • --showtime= was never documented so any breakage should be allowed - besides it possibly never having worked properly

@firewave firewave marked this pull request as ready for review September 27, 2023 10:10
@firewave
Copy link
Collaborator Author

This is finally ready for review.

Copy link
Owner

@danmar danmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks good to me.. just a small spelling typo

}
}

// TODO: wee need to get the timing information from the subprocess
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spelling: wee => we

@firewave firewave merged commit fc700b6 into danmar:main Oct 5, 2023
@firewave firewave deleted the showtime branch October 5, 2023 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants