[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 7/7] tools/proctrace: add proctrace tool


  • To: Wei Liu <wl@xxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxx>
  • Date: Fri, 26 Jun 2020 14:24:51 +0100
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Michał Leszczyński <michal.leszczynski@xxxxxxx>, Tamas K Lengyel <tamas.lengyel@xxxxxxxxx>, "Kang, Luwei" <luwei.kang@xxxxxxxxx>
  • Delivery-date: Fri, 26 Jun 2020 13:25:12 +0000
  • Ironport-sdr: XXeK9ztN8Q4G5Q+vpgZIaNeqdGGaj44a4E3h5jgkHVJ69nRZwP2rEGKj/Qw0GF6TwZpBcuZvOk v1nqrrF9RuSwOtsJJYDbBycB6DiLEQnEi8ZPWojZ2TFDeGKZoGy7DsPzAzMOyE01qLkrmKkViI 9yTgtnz6hSM1FFEcZyQ0/VNNIXT08JgEQMHv1dAaxZs0fHmfUPyRs6BctieVJxg9vMC5Kq/9g/ OX8p6nohivV5opyEadARG0mzBACytNklgWVRoyJqoQ66p6AwGjTXjlfP3Wjvgk6i4bujh1XOK8 P+I=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Wei Liu writes ("Re: [PATCH v3 7/7] tools/proctrace: add proctrace tool"):
> On Mon, Jun 22, 2020 at 08:12:56PM +0200, Michał Leszczyński wrote:
> > Add an demonstration tool that uses xc_vmtrace_* calls in order
> > to manage external IPT monitoring for DomU.
...
> > +    if (rc) {
> > +        fprintf(stderr, "Failed to call xc_vmtrace_pt_disable\n");
> > +        return 1;
> > +    }
> > +
> 
> You should close fmem and xc in the exit path.

Thanks for reviewing this.  I agree with your comments.  But I
disagree with this one.

This is in main().  When the program exits, the xc handle and memory
mappings will go away as the kernel tears down the process.

Leaving out this kind of cleanup in standalone command-line programs
is fine, I think.  It can make the code simpler - and it avoids the
risk of doing it wrong, which can turn errors into crashes.

Ian.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.