On Sun, Apr 3, 2022 at 5:56 PM Joel Fernandes <joel@xxxxxxxxxxxxxxxxx> wrote: > > On Fri, Apr 01, 2022 at 07:06:29PM -0400, Steven Rostedt wrote: > > On Fri, 1 Apr 2022 15:50:10 -0400 > > Joel Fernandes <joel@xxxxxxxxxxxxxxxxx> wrote: > > > > > export TRACECMD_TEMPDIR="/data" > > > > > > That’s fair. What about using memfd for this, do you feel that’s > > > reasonable? I have not yet measured how big this file gets but if it’s > > > small enough that might work too. > > > > Is this a separate question? That is, do you mean using the above > > environment variable *and* then use memfd? > > > > I believe that the cache is used for passing the compressed data from the > > guest to the host. I don't think it will be more than one compressed chunk. > > > > But Tzvetomir would know better. > > Hey Steve, > No its the same question. Instead of temp file, I was proposing in-memory > file using memfd_create(2), that way no hassle as long as the file is not too > huge. > Hi Joel, That cache file is used for constructing the trace meta-data on the guest, before sending it to the host. Usually it is compressed, but it could be uncompressed in some cases (depending on the configuration) - and in that case it can grow up to a few megabytes. Using memfd is ok in most cases, but I'm wondering in the worst case - these few megabytes could be a problem, especially if the guest runs with a minimum amount of memory. > Also looks like my patch is incomplete anyway, I need to change > tracecmd_msg_handle_cache() as well. > > I'll try to write up a patch with memfd unless you guys disagree. > > Thanks, > > - Joel > -- Tzvetomir (Ceco) Stoyanov VMware Open Source Technology Center