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

554 demangler parsing fixes for tracing #578

Merged
merged 13 commits into from
Dec 10, 2019
Merged

Conversation

pnstickne
Copy link
Contributor

@pnstickne pnstickne commented Nov 19, 2019

Basic idea of unification and pushing out responsibilities. Still need to wire in the arguments.

Drafted to 554 as a pre-req.

Fixes #554

return &proxyOperatorToNewInstanceReg<ObjType, Args...>;
}

static std::string traceGetEventType() {

This comment was marked as outdated.

static std::string traceGetEventName() {
using TE = vt::util::demangle::TemplateExtract;
using DU = vt::util::demangle::DemanglerUtils;
//auto args = DU::join(",", TE::getTypeNames<Args...>());

This comment was marked as outdated.

}

static size_t getNumArgs() {
return 0; // lies - see NumArgsTag, perhaps
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is used/relevant for these types? :-/

}

template <typename ActFnT, typename RegT, typename InfoT, typename FnT>
template <typename RunnableT, typename RegT, typename InfoT, typename FnT>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Runnable-needs-Adapter (RunnableT::AdapterType), both are separate template types.

auto operator()(A&&... a) -> decltype(auto) {
return f(std::forward<A>(a)...);
}
static std::string traceGetEventType() {

This comment was marked as resolved.

/// - FunctionPtrType
/// - ObjType
/// - getFunction
/// - traceGetEventType

This comment was marked as outdated.

@pnstickne

This comment has been minimized.

@pnstickne pnstickne marked this pull request as ready for review November 22, 2019 09:33
@pnstickne pnstickne requested review from nmm0 and uhetmaniuk November 22, 2019 09:33
@pnstickne

This comment has been minimized.

@pnstickne
Copy link
Contributor Author

pnstickne commented Nov 23, 2019

@lifflander This is ready to go. I would merge this as it also includes the #575 issues and fixes SEGV's that occur in several examples (including 'reduce).

Only one test fails locally, and I believe that to be a test consistency issue (sometimes is it transpose_4, transpose_8, or both).

99% tests passed, 1 tests failed out of 681

Total Test time (real) = 89.61 sec

The following tests FAILED:
132 - vt:transpose_8 (Failed)
Errors while running CTest
make: *** [test] Error 8

For reference, prior..

93% tests passed, 51 tests failed out of 681

Total Test time (real) = 1170.20 sec

@pnstickne
Copy link
Contributor Author

@lifflander Back-merged in 575.

@lifflander lifflander added this to the 1.0.0-beta milestone Nov 26, 2019
@lifflander
Copy link
Collaborator

I just rebased this on latest develop and changed the target.

/Users/jliffla/codes/vt/virtual-transport/src/vt/utils/demangle/demangle.cc:159:9: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
  if (e >= 0 && typestr[e] == ')') {
      ~ ^  ~
1 warning generated.

@pnstickne Can you fix this warning? I'm not sure if there is actually a bug here or if this just needs to be removed?

@lifflander lifflander changed the base branch from 575-event-registry-bugs to develop November 27, 2019 19:45
@lifflander lifflander changed the title 554 demangler chk 554 demangler parsing fixes for tracing Nov 27, 2019
Copy link
Collaborator

@lifflander lifflander left a comment

Choose a reason for hiding this comment

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

This looks great and I'm ready to merge this once the warning is resolved.

@pnstickne
Copy link
Contributor Author

pnstickne commented Nov 30, 2019

Warning should be gone (it was a minor bug for an edge-case that is 'never expected to be reached' as it would require empty input after removing void ().

@pnstickne
Copy link
Contributor Author

Super super recommend. It also means that I can run tests with tracing mode enabled 💃

@pnstickne
Copy link
Contributor Author

pnstickne commented Dec 8, 2019

@lifflander
Having this in whatever main WIP would be so handy to avoid "random yet predictable crashes" failures during startup of various programs that hinder other development due to needing to have tracing disabled at compile-time.

pnstickne and others added 13 commits December 10, 2019 09:29
- Push concerns outward so that each implemnentation
  can correctly sort out what it needs to do.

  (Previously some auto-reg that supplied a functor could
   bypass any internal wrappers making for split paths.)

  Also makes code a WEEEE bit easier to follow.
- Now that extensibility points have been pushed down,
  most of the special parsing code can be entirely eliminated.

  There only needs to remain some minimal support.
  It MAY also be possible to use type_id in SOME cases;
  however, the capture of the VALUE is probably not
  possible outside of __PRETTY_FUNCTION__ magic..
- Using the new contracts and extractors, wire in!
- Should now mostly parity the initial (and SEGV-happy) implementation
  that did lots of magical parsing..

  ..only "a small bit" of string magic is done with the new impl.

- Added some template 'overloads' as GCC was having a hard time
  (as in, not being able to and raising errors) the template values
  for TemplateA<T,T*> calling TemplateB<T,T>.
- Ensuring names are consistent to intent/usage
- Compiles in clang.. note the awesome "1 arg" case to avoid
  a clang COMPILER CRASH.

  Pretty awesome!?!
- Using NumArgsType instead of size_t, as per.. what
  should have been done.

- Also removed some spurious spaces returned to make
  results more consistent overall.
- Simple recursive iterator to deal better with template
  parameters involved in various types.
- Doesn't crash Clang
- Doesn't require recursive templates
- Not sure why this is not mentioned more online..
- Seriously, I aready wrote and lost a commit message.
- Call to 'getFunction' is done directly on AdapterType

- Removed '&' and specified type for simplicity/clarity
  (oops! force update with correction.. go compilation flags)
- While this case should 'never' be hit, it did lead to a valid
  compiler warning due to the unsigned nature of size_t.
@lifflander lifflander merged commit ea32b4e into develop Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants