Assignment 8 Dwarf Error and -gstabs Not Functioning?

Assignment 8 Dwarf Error and -gstabs Not Functioning?

by Dave Bhullar -
Number of replies: 4

Hi Dr. van Zon,

For Assignment 8, it appears that if I include in my Makefile 


then I get


But then if I do not include it


when I go on to run 

gprof --line ./wave2d gmon.out

I get many lines of Dwarf error


(which continues on) but then...



which appears to be what I am looking for? What is going on here? Please let me know and I would appreciate it.

Thank you.

In reply to Dave Bhullar

Re: Assignment 8 Dwarf Error and -gstabs Not Functioning?

by Dave Bhullar -
Adding note: despite the warnings I get when I include -gstabs, there are no lines of Dwarf error when I go on to run gprof --line ./wave2d gmon.out... weird... These warnings 
are still kind of sketchy though...
In reply to Dave Bhullar

Re: Assignment 8 Dwarf Error and -gstabs Not Functioning?

by Richard Banh -
Hey Dave,

I also had the same problem while working on the assignment over the weekend on the teach cluster.

You'll notice that the 'name' column in the Flat Profile you get from gprof (without -gstabs in the Makefile) doesn't point to specific lines in your function (e.g. one_time_step). To work around this, I just replaced the -gstabs debugging information flag with -gdwarf-2 . I'm not entirely sure what the differences are between the different debugging information flags for gprof, but this gave me specific run times for each line of code in the function. The loops I found from my gprof results seemed to make sense too.

I'm not too sure if it's ok to do this for the assignment, but it worked for me.

Best,

Richard
In reply to Richard Banh

Re: Assignment 8 Dwarf Error and -gstabs Not Functioning?

by Ramses van Zon -
Even though the compiler says stabs is not supported, the line-by-line profiling still works with it, while without it, you do not get line-by-line information. So you can ignore the compiler warnings. At the same time, I think Richard is right that replacing -gstabs with -gdwarf-2 is a better solutions as you do not get warnings.
In reply to Richard Banh

Re: Assignment 8 Dwarf Error and -gstabs Not Functioning?

by Dave Bhullar -
OK sounds good Dr. van Zon and Richard, thank you.