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: Patch: various Syscall changes


On Wed, Sep 06, 2006 at 07:23:39PM -0600, Tom Tromey wrote:
> This patch makes a few changes to Syscall:
> 
Hi, Tom,
This patch is fine to me except syscallByName(), :) and I have 
some comments, and questions.
> * Updates javadoc of syscallByNum
> * Fixed typo in syscallByNum
Thanks for updating these docs.
> * Changes syscallByNum to cache requested unknown syscalls, so that
>   each Syscall object is unique
Hmmm, the first thing in my mind is like this, :)
I think you are right.

if (num >= 0 && num < syscallList.length)
     return syscallList[num];
else if (num < 0)
     throw new RuntimeException ("Negative Syscall Number:" +
Integer.toString(num));
else
     return new Syscall ("Unknown_SYS_" + Integer.toString(num), num);

> * Adds equals() method.  We don't really need this but it is a
>   convenient place to add a comment
Yes, we do not really need this.
IMO, the name of syscall is the ID of it.  We could say they are the
same syscalls only if their names are the same.

All of them above are fine to me, and I would like to commit them with
my changes in other part of Syscall.

> * Adds syscallByName.  This is needed for 'ftrace -e' (or "--trace" as
>   I spell it in my impl...)
What do you want "--trace" to do in ftrace? Only trace a certain syscall?
If I am right, when we use ftrace like "ftrace --trace read ls", we
just want to see SYS_read called in "ls".

I do not think syscallByName is necessary here.  We could do something
like this in ftrace.java,

public Action updateSyscallEnter (Task task)
    {
      ......
      frysk.proc.Syscall syscall = syscallEventInfo.getSyscall(task)
      // trace_opt is a String that get value from commandline.
      // trace_opt is "read" in this case.
      if (syscall.getName().equals(trace_opt))
	{
	   ...
	}
     }

The only thing we could get, when enter/exit syscall, is syscall
number, and then we could map this number to different
syscalls(the same syscall number could map to different syscalls on
different architecture), and then extract all the information of a 
syscall, such as arguments and return value.

Most of the time, we just want to know, "what is the name of this
syscall?" *only* when the program meets an syscall.  That is to say,
debugger is only interested in syscall information when program meets 
syscall.  We will seldom want to know which syscall is named "read" 
when the  program does not meet an syscall.  Comments?

If you do not use it in this way in ftrace, please tell me.  I
am refactoring Syscall and SyscallEventInfo for multi-arch
syscallList, so how Syscall and SyscallEventInfo are used is important
for me to design.
Thanks!

-- 
Yao Qi


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