public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* How to determine whether a file was opened O_DIRECT?
@ 2006-08-29  8:03 Böszörményi Zoltán
  2006-08-29  8:55 ` Helge Hafting
  0 siblings, 1 reply; 4+ messages in thread
From: Böszörményi Zoltán @ 2006-08-29  8:03 UTC (permalink / raw)
  To: linux-kernel

Hi,

I would like to run some diagnostics on a database
process and I would like to know what flags it used
for opening its files. Is there any way to get this info?

Thanks in advance,
Zoltán Böszörményi


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to determine whether a file was opened O_DIRECT?
  2006-08-29  8:03 How to determine whether a file was opened O_DIRECT? Böszörményi Zoltán
@ 2006-08-29  8:55 ` Helge Hafting
  2006-08-29  9:15   ` Böszörményi Zoltán
  2006-10-09  3:44   ` Eugene Teo
  0 siblings, 2 replies; 4+ messages in thread
From: Helge Hafting @ 2006-08-29  8:55 UTC (permalink / raw)
  To: Böszörményi Zoltán; +Cc: linux-kernel

Böszörményi Zoltán wrote:
> Hi,
>
> I would like to run some diagnostics on a database
> process and I would like to know what flags it used
> for opening its files. Is there any way to get this info?
>
> Thanks in advance,
> Zoltán Böszörményi
>   
1. Look at the source code for the database - if you have it.
2. Run your database under strace, then search the voluminous
    output for "open" calls and look at the flags.
3. Patch your kernel to "printk" information whenever
    someone opens with O_DIRECT.

Helge Hafting

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to determine whether a file was opened O_DIRECT?
  2006-08-29  8:55 ` Helge Hafting
@ 2006-08-29  9:15   ` Böszörményi Zoltán
  2006-10-09  3:44   ` Eugene Teo
  1 sibling, 0 replies; 4+ messages in thread
From: Böszörményi Zoltán @ 2006-08-29  9:15 UTC (permalink / raw)
  To: Helge Hafting; +Cc: linux-kernel

> BĂśszĂśrmĂŠnyi ZoltĂĄn wrote:
>> Hi,
>>
>> I would like to run some diagnostics on a database
>> process and I would like to know what flags it used
>> for opening its files. Is there any way to get this info?
>>
>> Thanks in advance,
>> ZoltĂĄn BĂśszĂśrmĂŠnyi
>>
> 1. Look at the source code for the database - if you have it.

Unfortunately not.

> 2. Run your database under strace, then search the voluminous
>     output for "open" calls and look at the flags.

I can't do that, it's a production machine. But ...

> 3. Patch your kernel to "printk" information whenever
>     someone opens with O_DIRECT.

... this should have been obvious. :-) Thanks.

I just thought a command like fuser
may already exists to give me this info.
Or something under /proc/PID/fd.

>
> Helge Hafting
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to determine whether a file was opened O_DIRECT?
  2006-08-29  8:55 ` Helge Hafting
  2006-08-29  9:15   ` Böszörményi Zoltán
@ 2006-10-09  3:44   ` Eugene Teo
  1 sibling, 0 replies; 4+ messages in thread
From: Eugene Teo @ 2006-10-09  3:44 UTC (permalink / raw)
  To: Helge Hafting; +Cc: Böszörményi Zoltán, linux-kernel

Helge Hafting wrote:
> Böszörményi Zoltán wrote:
>> Hi,
>>
>> I would like to run some diagnostics on a database
>> process and I would like to know what flags it used
>> for opening its files. Is there any way to get this info?
>>
>> Thanks in advance,
>> Zoltán Böszörményi
>>   
> 1. Look at the source code for the database - if you have it.
> 2. Run your database under strace, then search the voluminous
>    output for "open" calls and look at the flags.
> 3. Patch your kernel to "printk" information whenever
>    someone opens with O_DIRECT.

$ stap -x PID -e 'probe syscall.open { if (target() == pid()) log(argstr) }' \
| grep O_DIRECT
"/net", O_RDONLY|O_DIRECTORY|O_LARGEFILE|O_NONBLOCK
"/net", O_RDONLY|O_DIRECTORY|O_LARGEFILE|O_NONBLOCK
...

http://www.sourceware.org/systemtap

Eugene
-- 
eteo redhat.com  ph: +65 6490 4142  http://www.kernel.org/~eugeneteo
gpg fingerprint:  47B9 90F6 AE4A 9C51 37E0  D6E1 EA84 C6A2 58DF 8823


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-10-09  8:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-29  8:03 How to determine whether a file was opened O_DIRECT? Böszörményi Zoltán
2006-08-29  8:55 ` Helge Hafting
2006-08-29  9:15   ` Böszörményi Zoltán
2006-10-09  3:44   ` Eugene Teo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox