uftrace function tracing tool support for V8 project

131 views
Skip to first unread message

Honggyu Kim

unread,
Nov 15, 2016, 9:59:31 AM11/15/16
to v8-dev, Namhyung Kim
Hi all,

I would like to introduce a recently open-sourced function tracing tool, called uftrace for V8 project development.

The uftrace tool is to trace and analyze execution of a program written in C/C++. It was heavily inspired by the ftrace framework of the Linux kernel (especially function graph tracer) and supports userspace programs. It supports various kind of commands and filters to help analysis of the program execution and performance.

This tool is developed by my colleague, Namhyung Kim and I have been used it to analyze V8 code base and also helped him to improve the tool.  I presented this tool in CppCon 2016 in both poster session and lightning talk as well.  So you can see my talk from the youtube link below: (it's just 6 mins)

I also added a feature to see the result in chrome trace viewer.  Some execution traces are uploaded in the below links:


If you open those links in chrome browsers, you can easily see the shape of workloads for each benchmark.

I've just uploaded a patch because uftrace requires target binaries to be compiled with -finstrument-functions or -pg option.

I hope this tool is useful to V8 developers!

Thanks,
Honggyu

Honggyu Kim

unread,
Nov 16, 2016, 6:28:12 AM11/16/16
to v8-dev, namh...@gmail.com, mache...@chromium.org, yan...@chromium.org
I think the below materials can give you better understanding of uftrace tool.


uftrace provides many features that are not well covered by the materials as follows:

1. report command
This command collects trace data from a given data file and prints statistics and summary information. It shows function statistics by default, but can show thread statistics with the --threads option and show differences between traces with the --diff option.

2. graph command 
This command shows a function call graph for the given function in a uftrace record datafile. If the function name is omitted, main is used by default. The function call graph contains backtrace and calling functions. Each function in the output is annotated with a hit count and the total time spent running that function.

3. tracing function arguments and return values
The uftrace tool supports recording function arguments and/or return values using the -A/--argument and -R/--retval options respectively.

If anyone wants to learn more, please see the below wiki page:

Thanks,
Honggyu
Reply all
Reply to author
Forward
0 new messages