On Sun, Oct 20, 2019 at 12:51 AM Nidhi Agrawal <nidhi11...@gmail.com> wrote:
>
> I came to this conclusion because the pprof implemented the cpu with the 
> assumption that the client gives how much time to capture the profiling data. 
> but when it comes to the mutex and block, the pprof didn't implement it to 
> support this but asked the client to call the profile rate before calling the 
> pprof function. This made me question why is there a difference in the 
> profiling technique, is it expected from us to set profile rate at the start 
> of the program, if not then why didn't they implement it similar to the cpu.

I'm sorry, I don't really understand what you mean.

There is really no difference among CPU, block, and mutex profiling
with regard to how they are used.  In all cases you start profiling,
do some work, and then fetch the profile.  They are all more or less
the same.  I don't understand what is leading you to conclude that
they are different.

Heap profiling, on the other hand, really is different, and it is
documented differently in runtime/pprof.

Ian


> On Sun, Oct 20, 2019 at 1:10 PM Ian Lance Taylor <i...@golang.org> wrote:
>>
>> On Sun, Oct 20, 2019 at 12:36 AM Nidhi Agrawal <nidhi11...@gmail.com> wrote:
>> >
>> > Because it is explicitly written in the documentation here 
>> > https://golang.org/pkg/net/http/pprof/ that we should set block profile 
>> > rate at the start of application, unlike CPU profiling where the rate is 
>> > being set internally before profiling starts.
>>
>> I'm likely missing something, but I'm looking at
>> https://golang.org/pkg/net/http/pprof, and I don't see that.  I see
>> that it says that you have to call runtime.SetBlockProfileRate or
>> runtime.SetMutexProfileFraction, but I don't see anything that says
>> that you have to call it at the start of the application.
>>
>> Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXMkT_aOtkCd4QTAi1E2-cOcwTNLtQ85iteJJte6sURMA%40mail.gmail.com.

Reply via email to