From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SDRlHjaGpmDUXgAAWB0awg (envelope-from ) for ; Thu, 20 May 2021 11:54:30 -0400 Received: by simark.ca (Postfix, from userid 112) id 6E6751F11C; Thu, 20 May 2021 11:54:30 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_REPLYTO_END_DIGIT,MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.lttng.org (lists.lttng.org [167.114.26.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C1EE81E813 for ; Thu, 20 May 2021 11:54:28 -0400 (EDT) Received: from lists-lttng01.efficios.com (localhost [IPv6:::1]) by lists.lttng.org (Postfix) with ESMTP id 4FmDnc2VYGz1rh7; Thu, 20 May 2021 11:54:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.lttng.org; s=default; t=1621526068; bh=90N56Ifv1RJeSc/tMKTZ2e+lV5iBz2P6eRU602hgnnY=; h=References:In-Reply-To:Date:To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=uY5/L0KctTDM8MLPcxtApt6u+Oxr1g1EwB2VqBI8lM5y80+6J5VtmtJzQ2avOHll3 PM4xxqE0UJiDACm+xmxjCPS4U1aevt6eVZM99w14JYgKvwVFIvFUqU0ZXnIzb/lnt/ +vyXJW80BH31u1XaR7CK4qphjXPavGtdk8U6+FxZ2hFTD9pwDtEl1Kdt1ogJ+hwFO+ Dr/tJrtqp6SXW5R4OvKAQLhsYwLuyutq0VjfioobQA83ASyab3Yh2TM+CdX2smgrjl Ow5jjEUqXQPOtKMW3hFBUZW/kDLqhX1mlpyYSg9hhBYSA+jMtjjcnYITBYSHj9BgbA mDRY/xRa11Ofg== Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) by lists.lttng.org (Postfix) with ESMTPS id 4FmDnb70M1z1rh6 for ; Thu, 20 May 2021 11:54:27 -0400 (EDT) Received: by mail-oo1-xc32.google.com with SMTP id s1-20020a4ac1010000b02901cfd9170ce2so3884075oop.12 for ; Thu, 20 May 2021 08:54:27 -0700 (PDT) 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=0VnzijFU9mOA6wU7rpSJ/S2VTjRJH/GekYI70SpoFAE=; b=E8OzlJkCDh5qheweda6HQfsSLA9Q/WS4EP3HI+wiHL1UlIWYyZu4/9gIxkdUA5u9p/ Y+JcGCJvjdsulQhwo0wtUu+t/ooQVucM+LFX+2MKSl17RfExdSoXy8152bgIuXTwl9Vp zRRrNHHivhSsPv+VqBjV4wkDQ+2zGhmMZGPKDLkmvCtSHAFGs0IejdfnL/HnOB084cJX soaq3cXfyWdqrEe1GkAxMn8qwhGJCL7SVWM9KyhbbTDG5pD56opQ361APYoTRG67J+hm P92DsUtN7VCkbcAN2j+DgrAjrFNc/TcAkVwHN+nwBvkBwutSizVTTH6azb+6HzpwSmQH Ryng== X-Gm-Message-State: AOAM532UZRKb1ZKzhuZp+3TfJG372wak+Xd9BmSYPYo60DCIj3HID6PX dvKHScyaqbGHn6em6hZuUi+XCgSOWSEkU22rodg= X-Google-Smtp-Source: ABdhPJyOWNWwo1QMQxWW3v3F4c/pA8qrujmbFAlv+33pn0niZbXpwc2akdnS6UpweDC7dQwXAEmaWZBHD78p3QdUlCw= X-Received: by 2002:a4a:abc8:: with SMTP id o8mr4301591oon.77.1621526067154; Thu, 20 May 2021 08:54:27 -0700 (PDT) MIME-Version: 1.0 References: <20210520121807.55428-1-nolange79@gmail.com> <1600729511.52338.1621520352970.JavaMail.zimbra@efficios.com> <982122605.52445.1621524098787.JavaMail.zimbra@efficios.com> In-Reply-To: <982122605.52445.1621524098787.JavaMail.zimbra@efficios.com> Date: Thu, 20 May 2021 17:54:16 +0200 Message-ID: To: Mathieu Desnoyers Cc: lttng-dev Subject: Re: [lttng-dev] [PATCH lttng-ust] Improve tracelog handling, reduce exported functions X-BeenThere: lttng-dev@lists.lttng.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: LTTng development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Norbert Lange via lttng-dev Reply-To: Norbert Lange Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" Am Do., 20. Mai 2021 um 17:21 Uhr schrieb Mathieu Desnoyers : > > ----- On May 20, 2021, at 10:57 AM, Norbert Lange nolange79@gmail.com wrote: > > > Am Do., 20. Mai 2021 um 16:19 Uhr schrieb Mathieu Desnoyers > > : > >> > >> ----- On May 20, 2021, at 8:18 AM, lttng-dev lttng-dev@lists.lttng.org wrote: > >> > >> > Instead of creating functions for each loglevel, simply pass the > >> > callback as argument. > >> > > >> > Further pack all preprocessor information into a struct that > >> > the compiler already can prepare. > >> > >> This introduces an ABI break too late in the cycle. > > > > So 2.14 would be the next chance I guess > > No. The original ABI was introduced about 10 years ago with lttng-ust 2.0, > and lttng-ust 2.13 introduces the first ABI break since. I don't > plan on doing any ABI break in lttng-ust in the foreseeable future. > > ABI breaks require that our users recompile all their instrumented > applications, which is really cumbersome for large software deployments. > We don't break ABI lightly. Yeah, I understand. > >> Also, I'm not so keen on adding an indirect call on the fast-path > >> when it's not absolutely needed. > > > > Code seems pretty similar: https://godbolt.org/z/oK1WhWqGT > > By fast-path, I also mean: > > + (*callback)(source->file, source->line, source->func, msg, len, > + LTTNG_UST_CALLER_IP()); > > Which introduces an indirect call which needs to be taken when tracing > is active. The worst thing is that it would tax branch-predictors. Indirect jumps aren't that horrible, and if you have public interpose-able ELF symbols you have more of them than you might know... And that's a function that calls a printf variant, and did alloc memory. > >> What is wrong with having one symbol per loglevel ? > > > > Macro-magic is cumbersome to edit, more code, more relocations. > > If it was still time for ABI breaks, I would be tempted to consider it > especially given that tracelog and tracef are not expected to be "high-speed", > but now is too late for breaking ABI. > > > > > Easier to adapt aswell, could roll my own tracelog functions while > > using lttng_ust__tracelog_printf (started soind that as I don't want > > to link to lttng-ust.so) > > What prevents you from linking against lttng-ust.so again ? I did not poke around enough with Lttng to be confident it wont have side effects, I really don't want it active in production. It doesn't seem there is much public knowledge with Xenomai either. lttng-ust.so will spawn threads, lttng-ust-tracepoint.so is mostly passive, So Id want a dynamic tracepoint-provider than i can dlopen (so that the signal masks are inherited, I hope you dont touch them). Of course I could just remove all lttng libraries on the production system aswell. Still doesnt change that tracelog and tracef doesnt work that way. I implemented my own tracelog/tracef using the normal lttng tracepoints for now, they totally break on source level with 2.13 aswell ;) is it ok if I do this to access them: #define TRACEPOINT_DEFINE #define TRACEPOINT_PROBE_DYNAMIC_LINKAGE // 2.12 // #include // #include // 2.13 #include #include ie. I would load lttng-ust.so later and can then use those tracepoints. Norbert _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev