Help!

How to determine whether a file was opened O_DIRECT?


Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Kernel (archive) RSS
Next:  [PATCH] Moschip 7840 USB-Serial Driver  
Author Message
Böszörményi_Zoltán
External


Since: Aug 29, 2006
Posts: 2



PostPosted: Tue Aug 29, 2006 10:10 am    Post subject: How to determine whether a file was opened O_DIRECT?
Archived from groups: linux>kernel (more info?)

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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo DeleteThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Helge Hafting
External


Since: Mar 29, 2005
Posts: 87



PostPosted: Tue Aug 29, 2006 11:00 am    Post subject: Re: How to determine whether a file was opened O_DIRECT? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo DeleteThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Böszörményi_Zoltán
External


Since: Aug 29, 2006
Posts: 2



PostPosted: Tue Aug 29, 2006 11:20 am    Post subject: Re: How to determine whether a file was opened O_DIRECT? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> 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. Smile Thanks.

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

>
> Helge Hafting
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.TakeThisOut@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Eugene Teo
External


Since: Jul 27, 2006
Posts: 18



PostPosted: Mon Oct 09, 2006 10:30 am    Post subject: Re: How to determine whether a file was opened O_DIRECT? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.TakeThisOut@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Kernel (archive) All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum