public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eugene Teo <eteo@redhat.com>
To: Helge Hafting <helge.hafting@aitel.hist.no>
Cc: "Böszörményi Zoltán" <zboszor@dunaweb.hu>, linux-kernel@vger.kernel.org
Subject: Re: How to determine whether a file was opened O_DIRECT?
Date: Mon, 09 Oct 2006 11:44:53 +0800	[thread overview]
Message-ID: <4529C5B5.4040804@redhat.com> (raw)
In-Reply-To: <44F400EA.5020506@aitel.hist.no>

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


      parent reply	other threads:[~2006-10-09  8:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4529C5B5.4040804@redhat.com \
    --to=eteo@redhat.com \
    --cc=helge.hafting@aitel.hist.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zboszor@dunaweb.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox