[SERVER-27162] instrument server code with high resolution CPU counter Created: 22/Nov/16  Updated: 06/Dec/22  Resolved: 16/Nov/18

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Misha Tyulenev Assignee: Backlog - Performance Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Product Performance
Participants:

 Description   

Current performance analysis tools such as vtune, linux perf do not allow to see how many cycles a predefined codepath takes.

  • gprof woudl be a good candidate but it does need to have modification in the source code to dump its output as server exists with call to _exit which will not execute atExit().
  • vtune and linux perf are good at analyzing lock contention and looking at statistically significant events. They are not good for answering a questions: how long (on average) does code path form point A to B runs in a given workload.
  • The proposal is to add a high res counter that can be used to instrument any code path to measure how many cycles it took and print the result in serverStatus output.
    Attached is a CR for a POC implementation that can be used as a starting point. In the provided example produces the output in the db.serverStatus:

    	"rdtsc tracer" : {
    		"Traced events for tag Find" : {
    			"HighRes Event #6" : " average: 4714900 , n: 2"
    		},
    		"Traced events for tag ConnS" : {
    			"HighRes Event #0" : " average: 109198 , n: 35"
    		}
    	},
    



 Comments   
Comment by April Schoffer [ 16/Nov/18 ]

Closing issue as no longer needed or low priority. Please re-open with rationale if request is still desired.

Generated at Thu Feb 08 04:14:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.