<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="" class=""><span style="" class=""><br style="">Hi Dave,</span></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br style="" class=""><span style="" class=""></span></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span style="" class="">one thing I want to correct:</span></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span style="" class="">I have my own read_ramdump function, <br style="" class=""></span></div><div class="" style="color: rgb(0, 0, 0); font-size:
 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span style="" class="">write function is still the same as of write_kdump <br></span></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">by the way<br><span style="" class=""></span></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span style="" class="">why do we need write function ?<br></span></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent;
 font-style: normal;"><br></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Currently I am using pc- >flags as of kdump itself, which I feel is not right.  (need to derive own set of flags for ramdump I suppose).</div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">moreover my thinking is following:</div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times
 new roman,new york,times,serif; background-color: transparent; font-style: normal;">1) implement a framework which provide hooks to implement conversion of raw ramdump to ELF.</div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">2) this hooks could be implemented by ramdump32/ramdump64 or even anybody else.</div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">3) have own set of flags and do not rely on KDUMP flags because this has nothing to do with Kdump.</div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">4) have its own read and write function.<br></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px;
 font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">please provide your inputs.</div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Regards,</div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Oza.<br><span style="" class=""></span></div><span style="" class=""></span><div class="" style="color: rgb(0, 0, 0); font-size: 11px; font-family:
 monospace; background-color: transparent; font-style: normal;"><br><span style="" class=""></span></div><div class="" style="color: rgb(0, 0, 0); font-size: 11px; font-family: monospace; background-color: transparent; font-style: normal;"><span style="" class=""><br style="" class=""></span></div> <div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div class="" style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div class="" style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="" class="" dir="ltr"> <font style="" class="" face="Arial" size="2"> On Friday, 30 May 2014 9:58 AM, paawan oza <paawan1982@yahoo.com> wrote:<br style="" class=""> </font> </div>  <br style="" class=""><br style="" class=""> <div style="" class=""><div style="" class="" id="yiv4072288549"><div style="" class=""><div class=""
 style="color:#000;background-color:#fff;font-family:times new roman, new york, times, serif;font-size:12pt;"><div class="" style=""><span class="" style=""><br class="" style="" clear="none">Hi Dave,</span></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br class="" style="" clear="none"><span class="" style=""></span></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><span class="" style="">1) what I talked about is pure 32bit (not with PAE, but should not be a problem with PAE)</span></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><span class="" style="">64 bit ELF headers could also be in place.</span></div><div
 class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br class="" style="" clear="none"></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">but my first and important point is: get 32bit implementation right (rest will fall after that)</div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">in other words, the design/framework has to be made in such a way that existing crash utility absorbs both ELF32 and 64 and even any other debugging format or not to mention for long term but 128 bit ELF format as well :)</div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times,
 serif;background-color:transparent;font-style:normal;">kdump should be capable of reading it I think.</div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br class="" style="" clear="none"></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">2) OK, so then after you've created the temporary ELF file, crash internally<br class="" style="" clear="none">would end up setting the pc->readmem() pointers to read_kdump()?  Or do<br class="" style="" clear="none">you have your own readmem() function in the new ramdump.c file? <br class="" style="" clear="none"></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br class="" style=""
 clear="none"></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">currently I am setting function point to kdump, so I dont have separate readmem function.</div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br class="" style="" clear="none"></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">3) Clarify one more thing please: is the temporary file simply a little standalone ELF<br class="" style="" clear="none">header that describes what's in the ddr.bin file?  Or do you concatenate the ELF<br class="" style="" clear="none">header and the ddr.bin file into a single, temporary, ELF vmcore file that<br class="" style=""
 clear="none">is essentially a clone
 of an ELF kdump dumpfile?<br class="" style="" clear="none"><span class="" style=""></span></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br class="" style="" clear="none"><span class="" style=""></span></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">it looks more closer to the former one which you mentioned.</div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">standalone ELF object. (Vmcore is ELF format anyway, so should be similar)</div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">not sure about kdump format
 though.<br style="" class="" clear="none"><span class="" style=""></span></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br style="" class="" clear="none"></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">PS: It might take some time to post the patch because I wrote it in hurry to make it work at the first point:but now I have to think with the design perspective and more on long term perspective to make this framework scalable and get easily accommodated in crash utility architecture.</div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br style="" class="" clear="none"></div><div class="" style="color:rgb(0, 0,
 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">Regards,</div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">Oza.<br style="" class="" clear="none"></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br style="" class="" clear="none"></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br style="" class="" clear="none"></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"> <br style="" class="" clear="none"></div><div class="" style="color:rgb(0, 0,
 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br style="" class="" clear="none"><span class="" style=""></span></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br style="" class="" clear="none"><span class="" style=""></span></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br style="" class="" clear="none"><span class="" style=""></span></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br style="" class="" clear="none"><span class="" style=""></span></div><div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new
 york, times, serif;background-color:transparent;font-style:normal;"><span class="" style=""><br class="" style="" clear="none"></span></div> <div style="" class=""><br style="" class="" clear="none"><br style="" class="" clear="none"></div><div style="" class="" id="yiv4072288549yqt04886"><div class="" style="display:block;"> <div class="" style="font-family:times new roman, new york, times, serif;font-size:12pt;"> <div class="" style="font-family:times new roman, new york, times, serif;font-size:12pt;"> <div class="" dir="ltr" style=""> <font class="" style="" face="Arial" size="2"> On Thursday, 29 May 2014 7:09 PM, Dave Anderson <anderson@redhat.com> wrote:<br class="" style="" clear="none"> </font> </div>  <br class="" style="" clear="none"><br class="" style="" clear="none"> <div class="" style=""><br class="" style="" clear="none"><br class="" style="" clear="none">----- Original Message -----<br class="" style="" clear="none">> Hi
 Dave,<br class="" style="" clear="none">> <br class="" style="" clear="none">> please find all my comments/clarifications/answers inline below.<br class="" style="" clear="none">> <br class="" style="" clear="none">> <br class="" style="" clear="none">> Since these raw DDR dumps seem to be an existing feature, it certainly<br class="" style="" clear="none">> seems worth implementing support
 for them.<br class="" style="" clear="none">> <br class="" style="" clear="none">> I'm curious as to how these RAM dumps are currently used -- are there other<br class="" style="" clear="none">> tools that use them somehow?<br class="" style="" clear="none">> <br class="" style="" clear="none">> Oza: there could be various tools which organisation might be writing to<br class="" style="" clear="none">> extract some logs, because they know the physical address<br class="" style="" clear="none">> where their private/public logs are stored.<br class="" style="" clear="none">> but none of the tools match the ability of crash utility as we all agree.<br class="" style="" clear="none">> <br class="" style="" clear="none">> Are these DDR RAM dumps specific to embedded 32-bit ARM machines?<br class="" style="" clear="none">> <br class="" style="" clear="none">> Oza: yes it depends, if it  is taken on armv7 then 32bit, if
 it is armv8,<br class="" style="" clear="none">> then 64 bit.<br class="" style="" clear="none"><br class="" style="" clear="none">Are you thinking of supporting this feature for ARM64 as well?<br class="" style="" clear="none"><br class="" style="" clear="none">Also, by any chance are you working with 32-bit ARM with PAE?  Currently<br class="" style="" clear="none">there is no support in the crash utility for ARM/PAE, and I have been <br class="" style="" clear="none">hoping/waiting for ARM developers on this list to develop and post patches<br class="" style="" clear="none">supporting it.  Although it's unclear whether the kdump facility would<br class="" style="" clear="none">even work as-is with PAE, if this feature were available, it would be an<br class="" style="" clear="none">an alternative to kdump.  Anyway, if/when ARM/PAE support is put in place,<br class="" style="" clear="none">it would require the usage of 64-bit ELF
 headers for the 32-bit ARM/PAE dumps. <br class="" style="" clear="none">But I'm getting ahead of myself...   ;-)<br class="" style="" clear="none"><br class="" style="" clear="none">> <br class="" style="" clear="none">>   <br class="" style="" clear="none">> Your feature sounds like a two-stage process:<br class="" style="" clear="none">> <br class="" style="" clear="none">> (1) invoke crash utility -- passing it the base physical address of the<br class="" style="" clear="none">>      contiguous RAM dump, and the RAM dump file name(s) -- and then crash<br class="" style="" clear="none">>      creates a single ELF vmcore by pre-pending an ELF header and<br class="" style="" clear="none">>      concatenating<br class="" style="" clear="none">>      the dump file names.<br class="" style="" clear="none">> (2) invoke crash utility with vmlinux and
 newly-created vmcore.<br class="" style="" clear="none">> <br class="" style="" clear="none">> Oza: yes it is 2 stage process, in the first stage crash utility will prepare<br class="" style="" clear="none">> something which crash utility itself can understand.<br class="" style="" clear="none">> which is nothing but ELF format, which every debugger typically understands<br class="" style="" clear="none">> (such as gdb)<br class="" style="" clear="none">> so I do that conversion at the first place.<br class="" style="" clear="none">> once that conversion is in place, crash utility core code takes it over and<br class="" style="" clear="none">> do the rest of the job. <br class="" style="" clear="none">> <br class="" style="" clear="none">> But you mention "generate object files" above.  Do you generate more than one<br class="" style="" clear="none">> file?<br class="" style="" clear="none">> <br class=""
 style="" clear="none">> Oza: what I meant by object file is ELF file (ELF is something which is ready to be loaded/linked)<br class="" style="" clear="none">> this object file is nothing but one temporary file which crash utility will create...<br class="" style="" clear="none">> so if you give<br class="" style="" clear="none">> <br class="" style="" clear="none">> crash ./vmlinux ./ramdump.bin kernel_base_address<br class="" style="" clear="none">> it woudl have created ramdump_ARM_ELF32  (temporary file) which crash utility will understand).<br class="" style="" clear="none">> after you exit crash, the temporary file would be deleted.<br class="" style="" clear="none">> <br class="" style="" clear="none">> Is the newly-created vmcore subsequently recognized as a netdump or kdump<br class="" style="" clear="none">> ELF vmcore?  (i.e, handled by existing code in netdump.c)<br class="" style="" clear="none">>
 <br class="" style="" clear="none">> Oza: it would be recognized as kdump (because I am currently using 'flags' of<br class="" style="" clear="none">> kdump), this is just to be aligned with crash internal implementations.<br class="" style="" clear="none">> <br class="" style="" clear="none">> but nontheless it is a separate ELF file<br class="" style="" clear="none"><br class="" style="" clear="none">OK, so then after you've created the temporary ELF file, crash internally<br class="" style="" clear="none">would end up setting the pc->readmem() pointers to read_kdump()?  Or do<br class="" style="" clear="none">you have your own readmem() function in the new ramdump.c file? <br class="" style="" clear="none"><br class="" style="" clear="none">> <br class="" style="" clear="none">> Or does it create a new ELF-like dumpfile type that is handled in your new ramdump.c file?<br class="" style="" clear="none">> Oza: it is
 separate ELF file.<br class="" style="" clear="none">> <br class="" style="" clear="none">> Could it be done in one step?  In other words, something like:<br class="" style="" clear="none">> <br class="" style="" clear="none">>   $ crash vmlinux --ddr 80000000 ddr1.bin [ddr2.bin ...]<br class="" style="" clear="none">> <br class="" style="" clear="none">> <br class="" style="" clear="none">> Oza: this is precisely what is hapepning.<br class="" style="" clear="none">> <br class="" style="" clear="none">> <br class="" style="" clear="none">> where there would be a "virtual" ELF header created that could be used<br class="" style="" clear="none">> during the crash session?  (perhaps with an optional "-o outputfile"<br class="" style="" clear="none">> command line option to create/save it as an ELF vmcore)<br class="" style="" clear="none">> <br class="" style="" clear="none">> Oza: virtual ELF
 header, and one more virtual program header would be created<br class="" style="" clear="none">> in temporary file which, the budle, called ELF32.<br class="" style="" clear="none">> optional command line option could be created as well. but currently we take<br class="" style="" clear="none">> bin file only.<br class="" style="" clear="none"><br class="" style="" clear="none">Clarify one more thing please: is the temporary file simply a little standalone ELF<br class="" style="" clear="none">header that describes what's in the ddr.bin file?  Or do you concatenate the ELF<br class="" style="" clear="none">header and the ddr.bin file into a single, temporary, ELF vmcore file that<br class="" style="" clear="none">is essentially a clone of an ELF kdump dumpfile?<br class="" style="" clear="none"><br class="" style="" clear="none">Also, I suggested the "-o outputfile" option -- after which you could simply enter<br class="" style=""
 clear="none">"crash vmlinux outputfile" -- because your implementation requires that the<br class="" style="" clear="none">user must be aware of the base physical address value.  <br class="" style="" clear="none"><br class="" style="" clear="none">Anyway, this all sounds good, so please post a patch.  And can you also make one of<br class="" style="" clear="none">these dumpfiles available to me to download?  <br class="" style="" clear="none"><br class="" style="" clear="none">Thanks,<div class="" id="yiv4072288549yqtfd23869" style=""><br class="" style="" clear="none">  Dave<br class="" style="" clear="none"> <br class="" style="" clear="none"><br class="" style="" clear="none"><br class="" style="" clear="none"><br class="" style="" clear="none"> <br class="" style="" clear="none"> <br class="" style="" clear="none"></div><br class="" style="" clear="none"><br class="" style="" clear="none"></div>  </div> </div>  </div></div>
 </div></div></div><br style="" class=""><br style="" class=""></div>  </div> </div>  </div> </div></body></html>