Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - depends on #44 - Global debugging settings atomization #48

Closed
wants to merge 10 commits into from
Closed

WIP - depends on #44 - Global debugging settings atomization #48

wants to merge 10 commits into from

Conversation

nsajko
Copy link
Contributor

@nsajko nsajko commented Jan 1, 2018

Just for reference.

#47

Allocation is removed from diag_os_newmtx and it is renamed to
diag_os_initmtx. diag_os_delmtx no longer frees.

The void typedef had to be corrected for static allocation of mutex
objects to be possible. (Note that no objects can be void in C, ie.
void is a null set.)
Accomplished by adding a new Macro constant and a new function.

Also applied to the only mutex, in diag_l2.c
Clang-format nicely formats/normalizes code and is quite smart,
assuring no line takes up more than 92 columns, also it gives us
nice alignments and whitespace usage in general.

It is able to break string literals or comments if needed.

Accomplished by a script like this, the looping/piping is because
clang-format is not idempotent as far as I know:

f() {
        clang-format '-style={BasedOnStyle: llvm, AllowShortFunctionsOnASingleLine: Empty, AlwaysBreakAfterReturnType: AllDefinitions, AlwaysBreakBeforeMultilineStrings: true, ContinuationIndentWidth: 8, IndentPPDirectives: AfterHash, IndentWidth: 8, UseTab: ForContinuationAndIndentation, ColumnLimit: 92, SortIncludes: false, PenaltyBreakComment: 0, PenaltyBreakString: 0, PenaltyReturnTypeOnItsOwnLine: 0}'
}

f | f | f | f
Also moved the mutex taking a bit in diag_l2_timer to lessen the time
during which the lock is taken by diag_l2_timer.
Added atomics stuff, we will also need it for fixing diag_l0_debug,
diag_l1_debug, diag_l2_debug, diag_l3_debug, diag_cli_debug usage.

Atomic accesses are used to fix the data races when the periodic
timers could try to take destroyed mutexes.
@fenugrec
Copy link
Owner

fenugrec commented Jan 2, 2018

If I'm not mistaken there is some overlap in the commits here and #44 ? this makes it slightly harder to review and merge, could you either

  • split the PRs to eliminate overlap if possible
  • mark the PRs as "WIP" until they're ready for review
  • prefer smaller, topical PRs rather than large ones like Stuff #44 !

Thanks!

@nsajko nsajko changed the title Global debugging settings atomization WIP - depends on #44 - Global debugging settings atomization Jan 4, 2018
@fenugrec
Copy link
Owner

fenugrec commented Mar 9, 2018

Hi, revisiting this after a break, is the global debug flag work complete ? I see some "tmp" commits so it's hard to tell

@nsajko nsajko closed this by deleting the head repository Sep 11, 2022
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