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

how caliper measures code region runtime? #123

Open
twang15 opened this issue Aug 26, 2018 · 2 comments
Open

how caliper measures code region runtime? #123

twang15 opened this issue Aug 26, 2018 · 2 comments

Comments

@twang15
Copy link

twang15 commented Aug 26, 2018

Using caliper instrumentation to measure end-to-end runtime, I am confused by the following 2 cases.

Suppose the program is instrumented as following:

main()
{
cali_begin_string_byname('loop', 'main')
..

cali_begin_string_byname('loop', 'loop1')
loop1 code
cali_end_byname('loop')

...
cali_begin_string_byname('loop', 'loop2')
loop1 code
cali_end_byname('loop')
..
cali_end_byname('loop')
}

After data collection, I process the data with
cali-query -s time.inclusive.duration --table a.cali

My expectation is that aggregation of caliper entry "main" should be the end-to-end runtime.
But, I observe two cases:

  1. for some apps, the result is as expected. The entries are like:
    main
    main/loop1
    main/loop2

  2. for others, there is no "main" entry, but only entries like
    main/loop1
    main/loop2

I am not sure why I see the differences between case 1 and case 2.
Could anyone explain this?

@daboehme
Copy link
Member

Are you sure the cali_end_byname() at the end of the main loop is there and being executed?

@twang15
Copy link
Author

twang15 commented Aug 28, 2018

Yes, it is executed.

Does cali_end_byname have to immediately follow a loop?
For example, in the following code snippet, function foo does not have a loop.
Will caliper time function foo properly?

cali_begin_by_string('foo', 'function1')
call foo()
cali_end_byname('foo')

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

No branches or pull requests

2 participants