This is the mail archive of the frysk@sources.redhat.com mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: migration to gelf


On Wed, Jun 21, 2006 at 01:28:16PM -0400, Adam Jocksch wrote:
> At this point the migration from libelf to gelf in the java bindings 
> (frysk-imports/lib/elf/) has been completed, and the testcase passes. If 
> anyone has any questions, comments, or concerns please feel free :)
> 
Hi, Adam,
I have some questions or concerns about libelf java bindings, and free
to correct me if I make mistakes.

1) ElfException is not informative enough.
In lib::elf::Elf::elf_begin, there are three exceptions may be thrown,
but could we add some information more in these exceptions?  For
example, I tried to use Class Elf to open /proc/<pid>/exe, and get an
exception that "Could not open file for reading".  I want to know what
is the name of this file further.

There are a lot of information in errno about what cause the
current problem, but we ignore it.  Why don't we translate errno to a
readable string and put it in ElfException messages?

2) Test case testProc(lib.elf.tests.TestElf) hard-wired pid to 1897.
It should fail if there is no such pid or user has no permission to
open /proc/1897/exe.  Error could be seen as follows,
Running testProc(lib.elf.tests.TestElf) ...ERROR
  lib.elf.ElfException: Could not open file for reading

Time: 0.12
There was 1 error:
1) testProc(lib.elf.tests.TestElf)lib.elf.ElfException: Could not open
file for reading
   at lib.elf.Elf.elf_begin(TestRunner)
   at lib.elf.Elf.<init>(TestRunner)
   at lib.elf.tests.TestElf.testProc(TestRunner)
   at frysk.junit.Runner.<init>(TestRunner)
   at TestRunner.main(TestRunner)

We could spawn a process, get its pid, and open /proc/<pid>/exe in this
test.

3) Test case is assumed only on X86.
ELF specification itself is a machine-independent one(correct me if I
make a mistake), but unit tests to ELF java bindings on different
architectures are needed, IMO.
The next question is how to put these test to different architectures
together, and what is the criteria or policy to select test case for
current target.
Frysk should have a capability to know "what kind of machine I am 
running on", and I think java binding to "uname" is a good choice. :)

-- 
Yao Qi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]