symfony 2 / doctrine 2:如何识别代码的哪些部分导致查询泄漏

So I am using symfony 2 and doctrine 2.

I am often fetching objects with a custom querybuilder, at least to avoid query leaks when looping through my objects and calling their nested elements.

However, I find it's sometimes difficult to figure out which part of the code is triggering a new request, ie where you forgot to fetch data before using it.

From the symfony2 profiler -> doctrine, I know what are the extra request, but is there a way to get back to the trace generating those requests ?? that would be very helpful !

Thanks a lot