Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Profile.callers to determine main callers of a particular function #7529

Merged
merged 1 commit into from
Aug 11, 2014

Conversation

timholy
Copy link
Sponsor Member

@timholy timholy commented Jul 6, 2014

EDIT: name changed to "callers"

This is somewhat like the Profiling analog of @which. It's quite useful in aggregating results from a complex sequence of runs.

Demo: in Gadfly/test,

julia> @profile include("test.jl")

julia> Profile.whocalled("cyclezip")
3-element Array{(Any,Any),1}:
 (392,LineInfo("circle","/home/tim/.julia/v0.3/Compose/src/form.jl",139,false))
 (214,LineInfo("text","/home/tim/.julia/v0.3/Compose/src/form.jl",249,false))  
 (3,LineInfo("rectangle","/home/tim/.julia/v0.3/Compose/src/form.jl",93,false))

@timholy timholy changed the title Add Profile.whocalls to determine main callers of a particular function Add Profile.whocalled to determine main callers of a particular function Jul 7, 2014
@timholy
Copy link
Sponsor Member Author

timholy commented Jul 7, 2014

EDIT: since this is retrospective, I changed the name from whocalls to whocalled. Compared to the original implementation, I also switched over to a keyword interface for more detailed match information, added the ability to specify a line range, and switched the order of the outputs. I edited the post above to match the new style.

I'm inclined to merge this, so let me know if this should wait for 0.4.

@quinnj
Copy link
Member

quinnj commented Jul 7, 2014

I was actually thinking the other night that something like this would be really useful. +1

@catawbasam
Copy link
Contributor

+1

@timholy
Copy link
Sponsor Member Author

timholy commented Jul 19, 2014

Thanks for the interest. I'll merge this once 0.4 development starts.

@timholy
Copy link
Sponsor Member Author

timholy commented Aug 11, 2014

Given the "whorequires" -> "dependents" renaming in #7924, I'll give one last chance for commenting on this name.

@IainNZ
Copy link
Member

IainNZ commented Aug 11, 2014

Profile.callers() ?

@timholy
Copy link
Sponsor Member Author

timholy commented Aug 11, 2014

I like it. I'll change it barring other suggestions.

@staticfloat
Copy link
Sponsor Member

I like .callers().

@timholy timholy changed the title Add Profile.whocalled to determine main callers of a particular function Add Profile.callers to determine main callers of a particular function Aug 11, 2014
timholy added a commit that referenced this pull request Aug 11, 2014
Add Profile.callers to determine main callers of a particular function
@timholy timholy merged commit eddf0c1 into master Aug 11, 2014
@timholy timholy deleted the teh/whocalls branch August 11, 2014 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants