• Forums
    • Public Forums
      • Community Connect
      • Dynatrace
        • Dynatrace Open Q&A
      • Application Monitoring & UEM
        • AppMon & UEM Open Q&A
      • Network Application Monitoring
        • NAM Open Q&A
        • Enterprise Synthetic Monitoring
      • Synthetic Classic
        • Synthetic Classic Open Q&A
  • Home /
  • Public Forums /
  • Application Monitoring & UEM /
  • AppMon & UEM Open Q&A /
avatar image
Question by Christian S. · Nov 26, 2013 at 12:10 PM ·

Capturing Arguments with Native ADK deep in C / C++ Code

Quick Question for the more experienced.

I`am trying to capture function Arguments in C/C++ Code deep within the Function because the Argument is a complex Type of some sort: Hence i did:

stuff
void func_call (ComplexType fooArg) {
#ifdef DYNATRACE
  DYNATRACE_API("STUFF");
  DYNATRACE_ENTER_CAPTURE();
#endif

  code
  code 
  more code

#ifdef DYNATRACE
   DYNATRACE_CAPTURE_INT64(long_var);
#endif

  more code
  even more code
  some more code
  return foo;
}

I couldnt find if that is property Syntax because the Native ADK Docs only specify catching Arguments in the DYNATRACE_ENTER_CAPTURE call itself.

In fact i was able to capture said long_var but in gets recorded as return Value not as argument like if  i had used DYNATRACE_EXIT_RETURN_INT64.

Has anyone experienced anything similar or is there a known Bug or Misbehavoir related to this?

Thanks for any Info upfront.

Comment

People who like this

0 Show 0
10 |2000000 characters needed characters left characters exceeded
â–¼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 52.4 MB each and 262.1 MB total.

4 Replies

  • Sort: 
  • Most voted
  • Newest
  • Oldest
avatar image

Answer by Christian S. · Nov 26, 2013 at 12:57 PM

hi Christian,

reason for this is simple: argument & return value capturing are based on the same mechanism, the only difference is that arguments are sent with the method enter event and return values with the method exit event. implication of this is that arguments can only be captured at the start of a method and return values (obviously) only at the end of a method.

so in your case the method enter event is already sent at DYNATRACE_ENTER_CAPTURE(), so the captured long_var is sent with the next event, which is the method exit in your case and so it's treated as the return value here.

this is the reason why you should only capture arguments & return values immediately before sending enter/exit events. and that's also why we introduced those macros which capture arguments/return values together with DYNATRACE_ENTER/_EXIT.

bottom line: you can capture the long_var out of this ComplexType as argument, if you extract and capture it before DYNATRACE_ENTER. but the current behavior is as intended.

hope this helps,

Christian

Comment

People who like this

0 Show 0 · Share
10 |2000000 characters needed characters left characters exceeded
â–¼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 52.4 MB each and 262.1 MB total.

avatar image

Answer by Christian S. · Nov 26, 2013 at 01:11 PM

Hi Christian,

that explains it. Too bad that i cant capture (in this particular case) anything useful from the Methods Entry Point directly as the Argument is a pointer to a XML Document which, in subsequent code, gets deconstructed. So placing the DYNATRACE_ENTER_CAPTURE deeper within the code at the  Point where i have extracted the relevant Node Information would loose the Tracing Informations regarding the deconstruction of the XML.

Thanks for the explanation and enlightnment.

Comment

People who like this

0 Show 0 · Share
10 |2000000 characters needed characters left characters exceeded
â–¼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 52.4 MB each and 262.1 MB total.

avatar image

Answer by Bernhard L. · Nov 27, 2013 at 12:28 PM

You may consider putting another DYNATRACE_ENTER_CAPTURE into your code after parsing the XML input. So you won't lose the trace (i.e. the timing information of the method itself) and have the arguments as "dummy" call inside the actual method call:

void func_call (ComplexType fooArg) {
  DYNATRACE_API("STUFF");
  DYNATRACE_ENTER();
 
  code
  code
  more code
  
  { // IMPORTANT: note the additional block here
    DYNATRACE_ENTER_CAPTURE(
      DYNATRACE_CAPTURE_INT64(long_var);
    );
    more code
    even more code
    some more code
    
    // leave internal 'dummy' call - put the EXIT *before* leaving the block
    DYNATRACE_EXIT();
  }
  // leave the actual call
  DYNATRACE_EXIT();
}

The "inner" call will have the same method name, but will have the captured arguments. In the PurePath tree view it will appear as:

(M) func_call()
 +  (M) func_call(long)      <arg value> ...


Best regards,
Bernhard

Comment

People who like this

0 Show 0 · Share
10 |2000000 characters needed characters left characters exceeded
â–¼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 52.4 MB each and 262.1 MB total.

avatar image

Answer by Christian S. · Nov 27, 2013 at 03:14 PM

Thats a very good suggestion, thanks. I will try it that way.

Comment

People who like this

0 Show 0 · Share
10 |2000000 characters needed characters left characters exceeded
â–¼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 52.4 MB each and 262.1 MB total.

Welcome to the
Dynatrace Community Forums

Check out the Community User Guide and First steps in the forum to learn how to get started.

Community Member of the Month
December 2019

Announcing Dynatrace's Community Member of the Month for December 2019, Enrico F.! Click here to read more!

Employee Member of the Month
December 2019

Announcing Dynatrace's Employee Member of the Month for December 2019, Silvia M.! Click here to read more!

Live webinar: Ensuring Digital Business Availability with Dynatrace

Learn how Dynatrace Real User Monitoring automatically detects errors that impact your end users caused by erroneous 3rd party or CDNs.
December 12, 4:00 pm CET / 10:00 am ET
Register here

Live webinar: Ensuring Digital Business Availability with Dynatrace

Learn how Dynatrace Real User Monitoring automatically detects errors that impact your end users caused by erroneous 3rd party or CDNs.
December 12, 4:00 pm CET / 10:00 am ET
Register here

Live webinar: Ensuring Digital Business Availability with Dynatrace

Learn how Dynatrace Real User Monitoring automatically detects errors that impact your end users caused by erroneous 3rd party or CDNs.
December 12, 4:00 pm CET / 10:00 am ET
Register here

Live webinar: Ensuring Digital Business Availability with Dynatrace

Learn how Dynatrace Real User Monitoring automatically detects errors that impact your end users caused by erroneous 3rd party or CDNs.
December 12, 4:00 pm CET / 10:00 am ET
Register here

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Forum Tags

dotnet mobile monitoring load iis 6.5 kubernetes mainframe rest api errors dashboard framework 7.0 appmon 7 health monitoring adk log monitoring services auto-detection uem webserver test automation license web performance monitoring ios nam probe collector migration mq web services knowledge sharing reports window java browser agent community user guide hybris javascript appmon sensors good to know search 6.3+ server documentation easytravel web dashboard kibana system profile purelytics docker splunk 6.1 process groups account 7.2 rest dynatrace saas spa guardian appmon administration production user actions postgresql upgrade oneagent measures security Dynatrace Managed transactionflow diagnostics user session monitoring unique users continuous delivery configuration alerting NGINX splitting business transaction client 6.3 installation chart database scheduler apache mobileapp RUM php dashlet azure purepath plugins agent 7.1 appmonsaas messagebroker nodejs 6.2 incidents android sensor performance warehouse
  • Forums
  • Public Forums
    • Community Connect
    • Dynatrace
      • Dynatrace Open Q&A
    • Application Monitoring & UEM
      • AppMon & UEM Open Q&A
    • Network Application Monitoring
      • NAM Open Q&A
      • Enterprise Synthetic Monitoring
    • Synthetic Classic
      • Synthetic Classic Open Q&A