linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Joel Fernandes <joel@joelfernandes.org>
Cc: linux-trace-devel@vger.kernel.org, vineethrp@google.com,
	tz.stoyanov@gmail.com
Subject: Re: [PATCH v2] trace-cmd: Move trace_msg cache file to memfd
Date: Mon, 4 Apr 2022 14:34:27 -0400	[thread overview]
Message-ID: <20220404143427.091a26bb@gandalf.local.home> (raw)
In-Reply-To: <20220403231825.1258376-1-joel@joelfernandes.org>

On Sun,  3 Apr 2022 23:18:25 +0000
Joel Fernandes <joel@joelfernandes.org> wrote:

> +++ b/lib/trace-cmd/trace-msg.c
> @@ -593,11 +593,9 @@ tracecmd_msg_handle_alloc(int fd, unsigned long flags)
>  int tracecmd_msg_handle_cache(struct tracecmd_msg_handle *msg_handle)
>  {
>  	if (msg_handle->cfd < 0) {
> -		strcpy(msg_handle->cfile, MSG_CACHE_FILE);
> -		msg_handle->cfd = mkstemp(msg_handle->cfile);
> +		msg_handle->cfd = memfd_create("trace_msg_cache", 0);
>  		if (msg_handle->cfd < 0)
>  			return -1;
> -		unlink(msg_handle->cfile);
>  	}

This causes:

trace-profile.c:23:3: warning: #warning "lib audit not found, using raw syscalls " "(install audit-libs-devel(for fedora) or libaudit-dev(for debian/ubuntu) and try again)" [-Wcpp]
   23 | # warning "lib audit not found, using raw syscalls "    \
      |   ^~~~~~~


Care to send a v3 update?

Man page shows:

SYNOPSIS
       #define _GNU_SOURCE         /* See feature_test_macros(7) */
       #include <sys/mman.h>

       int memfd_create(const char *name, unsigned int flags);

Note, all of trace-cmd is compiled with _GNU_SOURCE set.

-- Steve

      reply	other threads:[~2022-04-04 21:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-03 23:18 [PATCH v2] trace-cmd: Move trace_msg cache file to memfd Joel Fernandes
2022-04-04 18:34 ` Steven Rostedt [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=20220404143427.091a26bb@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=joel@joelfernandes.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=tz.stoyanov@gmail.com \
    --cc=vineethrp@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).