Operating System - HP-UX
1826679 Members
2282 Online
109696 Solutions
New Discussion

Why calls to functions in libclntsh.so often come from *ROOT* in the Call Graph section?

 
SOLVED
Go to solution
Dennis Handly
Acclaimed Contributor

Re: Why calls to functions in libclntsh.so often come from *ROOT* in the Call Graph section?

>I attached source.zip.

 

Does it have libclntsh.so?  If not, it is a deal breaker.  (And you probably don't have permission to supply it.)

I.e. The test case must be self contained except for standard HP-UX headers/shlibs.

 

>I thought that it would give to me a more correct caliper report.

 

Since you can't control libclntsh.so, anything in there is fixed.  The only thing you can change is useless calls to it.

 

>main () -> threadfunc() -> OCIStmtFetch() -> kpufch()

 

Assuming kpufch isn't recursive.  Your test_oci.gdb.txt didn't show recursion.  (Tail recursion would be hidden.)

 

>Am I right that a more correct libclntsh.so.11.1::OCIStmtFetch might look like this (roughly):

 

Well, the kpufch and $cold_kpufch should align:

                    100.00          321/321       100       test_oci::threadfunc(void*) [10]
[38]      5.0      1.87?             321?                 libclntsh.so.11.1::OCIStmtFetch [38]

                               ??                ??                  ??      libclntsh.so.11.1::kpufch [26]
                      98.13          378/378       100       libclntsh.so.11.1::$cold_kpufch [43]

 

And numbers adjusted.

 

>Am I right that there must be two items under OCIStmtFetch() and increased  % Total Hits?

 

It sure seems like it.  Or only one combined item under OCIStmtFetch for my suggestion 1).

blackwater
Regular Advisor

Re: Why calls to functions in libclntsh.so often come from *ROOT* in the Call Graph section?

Dennis,

Thanks a lot
Dennis Handly
Acclaimed Contributor
Solution

Re: Why calls to functions in libclntsh.so often come from *ROOT* in the Call Graph section?

Ok, I was successful in converting my gedanken experiment into a real test case.  The hardest part was to make it take enough time to get enough samples.

 

I filed an enhancement for you about Caliper and cold code:

QXCR1001253661:  Problems with scgprof and cold code, parent is *ROOT*

blackwater
Regular Advisor

Re: Why calls to functions in libclntsh.so often come from *ROOT* in the Call Graph section?

> I filed an enhancement for you about Caliper and cold code:
> QXCR1001253661:  Problems with scgprof and cold code, parent is *ROOT*

 

Please mention in  QXCR1001253661 that  sometimes there are completely different situations when a $cold_ function has a proper parent while the function itself has *ROOT* as a parent.
This was in one of uploaded Caliper reports:

------------------------------------------------------------------------
                     100.00            1                     *ROOT* [1]
[26]      3.7      6.41                -                 libclntsh.so.11.1::kpufch [26]
                      85.07           70/93         75       libclntsh.so.11.1::kpufch0 [24]
                       8.51           76/316        24       libclntsh.so.11.1::$cold_kpummTLSGET1 [62]
------------------------------------------------------------------------


------------------------------------------------------------------------
                     100.00           74/74        100       libclntsh.so.11.1::OCIStmtFetch [41]
[44]      1.9     54.38               74                 libclntsh.so.11.1::$cold_kpufch [44]
                      12.12          226/1486       15       libclntsh.so.11.1::sltstgi [51]
                      12.06          185/1432       13       libclntsh.so.11.1::sltstcu [45]
                      10.02          262/1487       18       libclntsh.so.11.1::sltsmnr [69]
                       6.81          204/1406       15       libclntsh.so.11.1::sltsmna [75]
                       4.61          229/1352       17       libclntsh.so.11.1::sltstan [104]
------------------------------------------------------------------------

Dennis Handly
Acclaimed Contributor

Re: Why calls to functions in libclntsh.so often come from *ROOT* in the Call Graph section?

>Please mention in  QXCR1001253661 that  sometimes there are completely different situations

 

I've included the URL of this topic, so hopefully they will see all if the info here, a real example.

I did find some existing Caliper bugs for cold code for cgprof, where some of the things I guessed/mentioned were already known.