mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: Namhyung Kim <namhyung@gmail.com>
Cc: linux-kernel@vger.kernel.org, Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH][trace-cmd] blk plugin: replace BLK_TC_BARRIER with BLK_TC_FLUSH/BLK_TC_FUA
Date: Mon, 9 Jan 2012 11:11:28 +0000	[thread overview]
Message-ID: <20120109111128.GA9468@stefanha-thinkpad.localdomain> (raw)
In-Reply-To: <874nw6xiqn.fsf@gmail.com>

On Mon, Jan 09, 2012 at 01:27:12AM +0900, Namhyung Kim wrote:
> Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> wrote:
> 
> > The BLK_TC_BARRIER flag was dropped in Linux commit c09c47caedc in
> > August 2011.  The blk plugin fails to build against recent kernel
> > headers.  Since no flag bits were left, the new BLK_TC_FLUSH flag reused
> > the BLK_TC_BARRIER bit.  The new BLK_TC_FUA flag was also added.
> >
> > This patch updates fill_rwbs() to reflect the new
> > BLK_TC_FLUSH/BLK_TC_FUA flags.  This allows plugin_blk.c to build
> > successfully on recent kernels.  The drawback is that this breaks the
> > build for pre-c09c47caedc kernel headers.
> >
> > Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
> > ---
> > There is an alternative version of this patch with a build test in the Makefile
> > so that we know whether to use BLK_TC_BARRIER or BLK_TC_FLUSH/BLK_TC_FUA.  That
> > would support both old and new kernel headers using a HAVE_BLK_TC_FLUSH #ifdef.
> >
> > I wasn't able to find the right makefile shell escaping magic to get the
> > build-test function to work.  If anyone knows how to test a snippet like the
> > following, then that would be nicer:
> >
> >   #include <linux/blktrace_api.h>
> >   int main(void) { return BLK_TC_FLUSH; }
> >
> 
> Hi,
> 
> The perf uses following code for that:
> 
> # try-cc
> # Usage: option = $(call try-cc, source-to-build, cc-options)
> try-cc = $(shell sh -c						  \
> 	'TMP="$(OUTPUT)$(TMPOUT).$$$$";				  \
> 	 echo "$(1)" |						  \
> 	 $(CC) -x c - $(2) -o "$$TMP" > /dev/null 2>&1 && echo y; \
> 	 rm -f "$$TMP"')

Looks perfect, thanks!

Stefan


      reply	other threads:[~2012-01-09 11:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-08 13:19 Stefan Hajnoczi
2012-01-08 16:27 ` Namhyung Kim
2012-01-09 11:11   ` Stefan Hajnoczi [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=20120109111128.GA9468@stefanha-thinkpad.localdomain \
    --to=stefanha@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@gmail.com \
    --cc=rostedt@goodmis.org \
    /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

all inboxes | Powered by JetHome®