Forum Discussion
Altera_Forum
Honored Contributor
13 years agodsl,
Thanks for your responses. I was able to get gprof to spit out the gmon.out by just placing an exit(0) function call after the portion of the code I wanted executed. I will say for anyone who reads this thread, make sure leave some time for the I/O to make it out of the JTAG UART before calling your exit function. For example, in my application (as well as in the "Profiling Nios II Systems" guide tutorial) a usleep function is called before the exit function call. This is necessary when using the profiler, because as soon as the BREAK 2 instruction is executed during the exit(), the application halts and the debug core takes over and transfers the gmon.out data back to the host. In my particular example, I had to invoke usleep with a larger tick count than what the tutorial used. When the tick count was too small, I would get the following error: --- Quote Start --- Using cable "USB-Blaster [USB-0]", device 1, instance 0x00 Processor is already paused Initializing CPU cache (if present) OK Downloaded 275KB in 4.7s (58.5KB/s) Verified OK Running target program until exit Uploading GMON data: 75% gmon data upload failed Leaving target processor paused --- Quote End --- However, when I used a larger tick count, gmon.out was created and uploaded back to the host: --- Quote Start --- Using cable "USB-Blaster [USB-0]", device 1, instance 0x00 Processor is already paused Initializing CPU cache (if present) OK Downloaded 275KB in 4.7s (58.5KB/s) Verified OK Running target program until exit uploaded gmon data: 28k in 0.8s Leaving target processor paused --- Quote End --- Again, thanks dsl for your responses and I hope this helps someone out there. -JQ