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: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ua1-x92d.google.com (mail-ua1-x92d.google.com [IPv6:2607:f8b0:4864:20::92d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id D7AA61F4BD; Thu, 10 Oct 2019 08:50:01 +0000 (UTC) Received: by mail-ua1-x92d.google.com with SMTP id q11so1685423uao.1; Thu, 10 Oct 2019 01:50:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=R7iFNM6ISlkyKBopXW4mRZnaHFfkd6HgVeJUUJLBtO4=; b=sxyekpgfHQ1YTL1N1kOMk3S43EoTUKxS+4adYdjS45z7QjoKiTdx5AliLTZSu+3Km4 70LTKTWAeatGqNz2G2yHdf7m5AR/WMCzhBYfIBYUF415mM3ORzq/Ivf20Wgq1QrBJh3C BA1yohg+mWxavlV+4eaiP5m/bvwoLxVw7BZ21o8AasdbGDcvSESeAQl3Xw+4o/TMW0Xt 2owS6HF4lf6kIbNI51mOYTzw0u3qfFzJ6auAEx7sQpKoI/3oUk5C+xlvsAPB0CaueH/F HsEKGN9niidmnKLtjUGgJD26Vx5+vstS1rPn5DP6RmDcVhka/3cEyfVqRFacXTTVpsLD S9mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=R7iFNM6ISlkyKBopXW4mRZnaHFfkd6HgVeJUUJLBtO4=; b=Yq6SXGu68l0lcFI0aMFbnXbAjEMXrvvjP0OqZtVwYj7+uWsZhsExBLDjWBrbd1qlEH 4dYUvvfUMWOGqm3J6UNcA1VrL6/jZQTveUEWib2t7Hg9eImijtxYVvTQnmgYch1XxTD0 1XsAu8gFjME7iufYeC5qRpCCAS0i0ZGNfg3ipX7e3NGGgwYN6eRonF/gyxa6MHkzM4iu 6oW1tRZ8G7UzZzOJ2DhEm7Ca6DoYamOFhEtLHod6Pr8ZUkyuyi3BLlNgMx0ZQ/IsygkM JbE+L3aZoBfIVdiygz1UIlWXFHg2xifwx2INs/4kLNhL8f3O90gWDrNsCWIBrlJAgKq/ 3LDA== X-Gm-Message-State: APjAAAWMXn6vRR1e3UxtoI39wIGx+0wDlVwKRr4jb2cfiAvOjnfWueU2 yLIqXBCu6XMRKyBzw707dqyxgDnG0AsiTyaJxWEyyXRYqnk= X-Google-Smtp-Source: APXvYqw8qT/LkMmU4A9pvG5f9YpVsPgct2LHDtcjb7zqSy9HSwfTXeIzT2sDi4KIlJwT3rExhnxwqZsiKBbbm8w3IhU= X-Received: by 2002:a9f:364c:: with SMTP id s12mr2596467uad.77.1570697400466; Thu, 10 Oct 2019 01:50:00 -0700 (PDT) MIME-Version: 1.0 References: <20191010084108.ai6glpnm3x4voru7@dcvr> In-Reply-To: <20191010084108.ai6glpnm3x4voru7@dcvr> From: Sam Saffron Date: Thu, 10 Oct 2019 19:49:49 +1100 Message-ID: Subject: Re: Add enable/disable methods To: Eric Wong Cc: mwrap-public@80x24.org Content-Type: text/plain; charset="UTF-8" List-Id: > 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. Oh I forgot about that, how about allowing it to start in 'disabled mode' via env and then only allowing a `Mwrap.enable` once. (with no .disable method) That helps a lot with the profiling of unicorn workers cause the master and multiple workers can be left in "almost zero impact" mode and you can simply nuke the worker you were profiling once done. On Thu, Oct 10, 2019 at 7:41 PM Eric Wong wrote: > > 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.