I've only tested that on ARM FS, so I'm not sure if that would make a difference if you're using something else.
Also, where did you add that code? Which file/method? I was able to do it in src/cpu/simple/atomic.cc:tick() as well as src/mem/abstract_mem.cc:access() Hope that helps somehow. On Tue, Feb 11, 2014 at 5:47 PM, Castillo Villar, Emilio < [email protected]> wrote: > I was having a similar problem, the PID was not always being read > properly and got some address translation errors as well. > In the end I added a m5 pseudo instruction to store the running pid in a > register. > > I call this pseudo inst from the kernel each time it does a context > switch. kernel/sched.c > > It's a quick &dirty hack but I was in a rush and couldn't figure anything > better. > ------------------------------ > *De:* [email protected] [[email protected]] en nombre > de Peng Wei [[email protected]] > *Enviado:* martes, 11 de febrero de 2014 23:19 > *Para:* gem5 users mailing list > *Asunto:* Re: [gem5-users] Trace Instruction Flow associated with PID > > Hi Martin, > > Thanks very much. I saw the PID this time. However, when I tried to use > the method you mentioned before: > http://www.mail-archive.com/[email protected]/msg08815.html, it kept > printing out warnings like this: > > warn: Device system.membus.badaddr_responder accessed by read to address > 0xffffffffffffffff size=1 > warn: Unable to translate virtual address: 0xa00006ee1b0a0ed > > and the PID is always 1797. > > Have you encountered the same issue? If so, how did you address it? > > Thanks again. > > Best regards, > > > > > On Mon, Feb 10, 2014 at 8:43 AM, Martin Brown <[email protected]> wrote: > >> Hi Peng, >> >> Yes that's the right kernel code. Once you have that you can apply the >> patch. Even though that files aren't there, they should be created by the >> patch. >> >> $ git apply patch-file-name >> >> Or if the patch doesn't apply properly, you can look at the patch file >> and apply it manually. >> >> Here's the one I compiled which includes the kernel info https://www. >> dropbox.com/s/wf09b4kkn3jh4ku/vmlinux-with_kernel_info >> >> If you use that, it should get you past the "thread info not compiled >> into kernel" problem. Then you should be able to get the PID using the code >> snippet that I pointed to in my previous message. >> >> Let me know if that doesn't work. >> >> >> >> >> On Sat, Feb 8, 2014 at 1:52 AM, Peng Wei <[email protected]> wrote: >> >>> Hi Martin, >>> >>> Could you please explain it more detailedly? I am now stuck by the >>> error of "don't have thread info compiled into the kernel", but I don't >>> know how to go further. I followed the step at " >>> http://gem5.org/BBench-gem5" to build kernel, but after I downloaded >>> the code from git, I could not even see the files in the patch. Is the >>> kernel code at "git clone git://linux-arm.org/linux-2.6-armdroid.git -b >>> 2.6.38-armdroid"? >>> >>> Thanks very much. >>> >>> >>> On Thu, Feb 6, 2014 at 10:47 PM, Martin Brown <[email protected]> wrote: >>> >>>> Hello, >>>> >>>> There's a thread that talks about getting the PID here >>>> http://www.mail-archive.com/[email protected]/msg08815.html >>>> >>>> You can include it in the DPRINTF() calls with the Exec flags. >>>> >>>> If it complains that you don't have thread info compiled into the >>>> kernel, try the patch from this thread >>>> https://www.mail-archive.com/[email protected]/msg06169.html >>>> >>>> If that doesn't work, or if this isn't what you're looking for let us >>>> know. >>>> >>>> >>>> On Thu, Feb 6, 2014 at 6:37 PM, Peng Wei <[email protected]> wrote: >>>> >>>>> Hi there, >>>>> >>>>> Are there any existing way to trace instruction flow associated with >>>>> process id? The debug flag "Exec" can generate instruction flow for us, >>>>> but >>>>> there is no PID associated with each instruction. Could anybody tell me >>>>> how >>>>> to generate instruction executing trace with pid for each instruction or >>>>> each section of instruction? >>>>> >>>>> Thanks very much. >>>>> >>>>> _______________________________________________ >>>>> gem5-users mailing list >>>>> [email protected] >>>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users >>>>> >>>> >>>> >>>> >>>> -- >>>> Martin >>>> >>>> _______________________________________________ >>>> gem5-users mailing list >>>> [email protected] >>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users >>>> >>> >>> >>> _______________________________________________ >>> gem5-users mailing list >>> [email protected] >>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users >>> >> >> >> >> -- >> Martin >> >> _______________________________________________ >> gem5-users mailing list >> [email protected] >> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users >> > > > _______________________________________________ > gem5-users mailing list > [email protected] > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users > -- Martin
_______________________________________________ gem5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
