Erlang performance analysis using FPROF within the CPU time

I am trying to use fprof for better performance visualization of my software. However, the default is to use wall clock measurement, but I want to use cpu time to measure it. Therefore, I am in the shell I ran the following command, but an error occurred. Can’t really find the reason why it failed on the Internet or erlang documentation. Does anyone have any tips?

% fprof:trace([start, {cpu_time, true}]).
{error,not_supported}

The cpu_time flag of fprof is converted to the cpu_timestamp of trace, as shown in the code snippet above:

According to http://erlang.org/doc/man/erlang.html#trace-3:

cpu_timestamp

A global trace flag for the Erlang node that makes all trace timestamps be in CPU time, not wallclock. It is only allowed with PidSpec==all. If the host machine operating system does not support high resolution CPU time measurements, trace/3 exits with badarg.

So if you call erlang: trace(all,true,[cpu_timestamp]) returns badarg Abnormal, it means that your platform does not support this feature.

I am trying to use fprof for better performance visualization of my software. However, the default is to use a wall clock Measured, but I want to measure it with cpu time. Therefore, I ran the following command on the shell, but an error occurred. I can’t really find the reason why it failed on the Internet or erlang documentation. Does anyone have any tips?

% fprof:trace([start, {cpu_time, true}]).
{error,not_supported}

The cpu_time flag of fprof is converted to the cpu_timestamp of trace, as shown in the above code snippet:

According to http://erlang.org/doc/ man/erlang.html#trace-3:

cpu_timestamp

A global trace flag for the Erlang node that makes all trace timestamps be in CPU time, not wallclock. It is only allowed with PidSpec==all. If the host machine operating system does not support high resolution CPU time measurements, trace/3 exits with badarg.

So, if calling erlang:trace(all,true,[cpu_timestamp]) returns a badarg exception, it means that your platform does not support this feature .

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 2621 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.