Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to use dbg and fprof to profile a running server ?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bo Chen  
View profile  
 More options Aug 28 2012, 5:17 am
From: Bo Chen <chenbo09t...@gmail.com>
Date: Tue, 28 Aug 2012 17:17:29 +0800
Local: Tues, Aug 28 2012 5:17 am
Subject: [erlang-questions] How to use dbg and fprof to profile a running server ?

Hello, every one,
            I am a rookie in erlang. Recently I am trying to use the dbg
and fprof module to profile a running server to observe the performance.
Since the server is based on mochiweb, a quite popular web server
framework, and I only wish to see the performance of my own code, I tried
the dbg module. I have tried in the following two ways:

1: use dbg to write trace to file and use fprof to analyse the result
dbg:stop_clear(),
dbg:tracer(port,dbg:trace_port(file,"fprof.trace")),
dbg:tpl(util,[]),
dbg:tpl(...),
dbg:p(all,[call,return_to, procs, timestamp,running,garbage_collection]),
dbg:stop_clear(),
fprof:profile(),
Fname = lists:append("profile/",Name),
fprof:analyse({dest, Fname}).

2: like fprof, but use dbg:tpl to confine the module
fprof:trace([start, {procs, all}]),
dbg:tpl(util,[]),
dbg:tpl(...),
fprof:trace([stop]),
fprof:profile(),
Fname = lists:append("profile/",Name),
fprof:analyse({dest, Fname}).

Sadly, neither way seems to work.

So any idea about how to combine the dbg and fprof module?
Or maybe someone would like to point out the mistake I have made?

Thanks in advance for your reply~

--
   陈波 / Bill
   2009级本科生
   清华大学软件学院
------------------------------------------------------------
   Chen Bo
   School of Software
   Tsinghua University
   Add: Building Zijing 1# Room 210B,
           Tsinghua University Beijing 100084
           P.R.CHINA
   Tel:  +86-010-51534210
   E-mail: chenbo09t...@gmail.com

_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Garrett Smith  
View profile  
 More options Aug 29 2012, 12:17 am
From: Garrett Smith <g...@rre.tt>
Date: Tue, 28 Aug 2012 23:16:53 -0500
Local: Wed, Aug 29 2012 12:16 am
Subject: Re: [erlang-questions] How to use dbg and fprof to profile a running server ?

e2 has a simple tracing helper that you might take a look at:

https://github.com/gar1t/e2

In a shell, you can run e2_debug:trace_module(some_module) or
e2_debug:trace_function(some_module, some_function) and you'll get
simple output printed to the console.

Here's the module:

https://github.com/gar1t/e2/blob/master/src/e2_debug.erl

It's by no means as flexible as using dbg directly, but it's very easy to use.

Garrett
_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jesper Louis Andersen  
View profile  
 More options Aug 30 2012, 11:25 am
From: Jesper Louis Andersen <jesper.louis.ander...@erlang-solutions.com>
Date: Thu, 30 Aug 2012 17:25:41 +0200
Local: Thurs, Aug 30 2012 11:25 am
Subject: Re: [erlang-questions] How to use dbg and fprof to profile a running server ?
On Aug 28, 2012, at 11:17 AM, Bo Chen <chenbo09t...@gmail.com> wrote:

> Hello, every one,
>             I am a rookie in erlang. Recently I am trying to use the dbg and fprof module to profile a running server to observe the performance. Since the server is based on mochiweb, a quite popular web server framework, and I only wish to see the performance of my own code, I tried the dbg module. I have tried in the following two ways:

I would look into eprof first. It will give you profile outputs in the "large" and when you then know where the time is spent I would target that area with fprof. Also, if you are running on multicore, don't skip the thought that you may have to do lock count profiling as well.

For your own code, I would set up a typical test case and then use that as the profile basis for fprof.

_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Björn-Egil Dahlberg  
View profile  
 More options Aug 30 2012, 11:54 am
From: Björn-Egil Dahlberg <e...@erlang.org>
Date: Thu, 30 Aug 2012 17:54:19 +0200
Local: Thurs, Aug 30 2012 11:54 am
Subject: Re: [erlang-questions] How to use dbg and fprof to profile a running server ?
On 2012-08-30 17:25, Jesper Louis Andersen wrote:
> On Aug 28, 2012, at 11:17 AM, Bo Chen <chenbo09t...@gmail.com> wrote:

>> Hello, every one,
>>              I am a rookie in erlang. Recently I am trying to use the dbg and fprof module to profile a running server to observe the performance. Since the server is based on mochiweb, a quite popular web server framework, and I only wish to see the performance of my own code, I tried the dbg module. I have tried in the following two ways:

> I would look into eprof first. It will give you profile outputs in the "large" and when you then know where the time is spent I would target that area with fprof. Also, if you are running on multicore, don't skip the thought that you may have to do lock count profiling as well.

> For your own code, I would set up a typical test case and then use that as the profile basis for fprof.

I agree with Jesper. Start with eprof to get a feeling for what might be
troublesome.
Also eprof can handle a much higher load than fprof can, i.e. eprof is a
magnitude or two faster.

The lock counter, lcnt, can also handle relative high loads. It can also
dismiss some results thus saving some memory and performance. lcnt can
also be used to see msg-queue locks on erlang processes, thus useful to
profile erlang application and not just to tweak the runtime.

// Björn-Egil
    Erlang/OTP
_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »