[ktap] Re: [PATCH] Change trace_seq_*() and add get_unused_fd_flags() to support Linux 3.18

  • From: Azat Khuzhin <a3at.mail@xxxxxxxxx>
  • To: ktap@xxxxxxxxxxxxx
  • Date: Fri, 19 Dec 2014 01:05:23 +0300

On Wed, Dec 17, 2014 at 02:08:41AM +0800, He Kuang wrote:
> Signed-off-by: He Kuang <hekuang@xxxxxxxxxx>
> ---
>  runtime/kp_events.c    |  2 +-
>  runtime/kp_transport.c | 38 ++++++++++++++++++++------------------
>  runtime/ktap.c         |  2 +-
>  runtime/ktap.h         | 29 +++++++++++++++++++++++++++++
>  runtime/lib_base.c     |  4 ++--
>  5 files changed, 53 insertions(+), 22 deletions(-)

<trimmed>
> @@ -186,7 +186,8 @@ static enum print_line_t print_trace_stack(struct 
> trace_iterator *iter)
>                       break;
>  
>               sprint_symbol(str, p);
> -             if (!trace_seq_printf(&iter->seq, " => %s\n", str))
> +             trace_seq_printf(&iter->seq, " => %s\n", str);
> +             if(trace_seq_has_overflowed(&iter->seq))

Wrong:
if(foo)

Correct:
if (foo)

<trimmed>
> diff --git a/runtime/ktap.c b/runtime/ktap.c
> index e5e18d7..aebe664 100644
> --- a/runtime/ktap.c
> +++ b/runtime/ktap.c
> @@ -174,7 +174,7 @@ static long ktapvm_ioctl(struct file *file, unsigned int 
> cmd, unsigned long arg)
>       int new_fd, err;
>       struct file *new_file;
>  
> -     new_fd = get_unused_fd();
> +        new_fd = get_unused_fd_flags(0);

   ^^^^^
Use tabs not spaces (and please check the whole patch)

Other related posts: