This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap 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: Access of global variables in the script


Hi -

> [...]
> I checked the function fullpath_struct_file in the dentry.stp. Can I
> code a better (faster) implementation than task_dentry_path() with
> inline C?
>
> A side note - task_dentry_path does not lock when traversing the
> dentry->parent... tree. Is it safe?

These two issues are related, and represent a deliberate design choice.
When one uses embedded-C code in stap, one has to shoulder the entire
burden of ensuring its safety & correctness.  A pointer use bug there
can bring the machine down.  Blocking for a lock can bring the machine
down.

In contrast, the same algorithm expressed within the script language
will use protected pointer dereferencing, time/space-limited
computation, and no blocking.  In the worst case, the script will stop,
or produce wrong results.  That is much better than the alternative.


> [...]
> semantic error: unable to find global 'rename_lock' in kernel, in
> fs/dcache.c: operator '@var' at <input>:1:36
> [...]

(Not sure about this part.)


- FChE


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