From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 9519C1F4BD; Thu, 10 Oct 2019 08:41:08 +0000 (UTC) Date: Thu, 10 Oct 2019 08:41:08 +0000 From: Eric Wong To: Sam Saffron Cc: mwrap-public@80x24.org Subject: Re: Add enable/disable methods Message-ID: <20191010084108.ai6glpnm3x4voru7@dcvr> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Id: Sam Saffron wrote: > Howdy, > > In our use case we would like to profile one of N unicorn workers > after a certain timeframe. > > Would you be open to adding > > `Mwrap.enable` : start profiling memory allocations > `Mwrap.disable` : disable all profiling of memory allocations, making > them as close as possible to a no-op. > > and an env var for starting disabled > > `MWRAP_OPTIONS=disabled` Would still have to pay the extra size + tracking overhead even in no-op mode; since post-enable free() can operate on pre-enable malloc() results. > > An additional convenience method here for the entire workflow would be: > > `mwrap so_path` that returns the path to the module that needs > preloading, this makes it slightly easier to configure production > environments. > > Thoughts? Should be doable. Got a bunch of other stuff coming up into the weekend; but should be able to find some time for it in a week or two.