Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3541439rdg; Tue, 17 Oct 2023 20:09:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMcUagmac0aejHL0H3IjCpzICb7ZK/OBYE9SahzLMjWBuqZWYph9F4YTe6plT/iVU/1KY1 X-Received: by 2002:a05:6a21:6d85:b0:17b:4b61:a8f7 with SMTP id wl5-20020a056a216d8500b0017b4b61a8f7mr436304pzb.9.1697598552856; Tue, 17 Oct 2023 20:09:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697598552; cv=none; d=google.com; s=arc-20160816; b=Z0pGyFJ6avQFoIsI/7A2JdRmS1b7ao1UD7uUhqvGbI2c+hgi/OKQhrRfWtiZC2GqD4 CUZP78H4OjbD7DJH5SiGECAsP/CEUgapyD0y1s9JDVs77jqhb5R6GGj/pRFWsrh7/drd TVhYH7wz45qWKhJKpojrsZhbcad40NH04PJaS06KM6aop8D/1lCzMEFlHico3lAsFmIF NX8+1/5ti+lJInnlKLFqRzmyCCJ44yl2Z9mCz/+8bmO9OYQFbyCwRFHhF9jBEp5uU/yA oMy3Kc3SVTeW2CCJlNP/szkt6/MgXMJLIRDUJxaEGrseXmKXRoOUUUiGZW0ah+bnEFiH eFow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=KxDvcwRJ+oCD8R03zg9Fvuf+jD2pBmCLjGOEJlTmezU=; fh=h3GKoPRcvKXdKSetRtLhaKn/1bRt8EU8R6FUX2MQC7A=; b=LUXQu3boJdYT4DdZuVErvYvyl6SOBDEfpb03mzqRqP1WAZW/KLsXjDCMqwfeHgPcxG UqfcVbJL5ULENRi7uW4rHqyit8NmBz46GsE4nGgbtK15JITjA5Vs8k+kpAkXfB7PXmrR 1fGV2iIsapp1IcNnKjLNiJHqTvgJG3eUvI4o7Bqd7O16/Lf+WmsA2bqlnQnzmyYdp5J9 ijLsyMwPLjzpXUv4HR0FQC8OR9wFHZePdN6cWqMhGdN1zncnSsUrVI1dQRXYdwhljX4M Y8snR86WNV1Luoe+eSoSE14UnNasM2peGgLHaUwmaoQnYGhCTX2xTkoLHaIaOfL5Tmxz 1fOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Iv5lFkNn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id s15-20020a170902ea0f00b001c0c79b3869si3616349plg.578.2023.10.17.20.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 20:09:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Iv5lFkNn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 5F637810EC24; Tue, 17 Oct 2023 20:09:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229497AbjJRDJC (ORCPT + 99 others); Tue, 17 Oct 2023 23:09:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjJRDJA (ORCPT ); Tue, 17 Oct 2023 23:09:00 -0400 Received: from mail-vs1-xe31.google.com (mail-vs1-xe31.google.com [IPv6:2607:f8b0:4864:20::e31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62F00C4 for ; Tue, 17 Oct 2023 20:08:58 -0700 (PDT) Received: by mail-vs1-xe31.google.com with SMTP id ada2fe7eead31-457cba20cb7so2058932137.1 for ; Tue, 17 Oct 2023 20:08:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697598537; x=1698203337; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KxDvcwRJ+oCD8R03zg9Fvuf+jD2pBmCLjGOEJlTmezU=; b=Iv5lFkNnmjR0Xdh+D+bHo3bAjZKfvKM5tXxNlFytzsrp0hO8Td1rP7sd1uJP+bxQVJ SqB1j/xD0soNezoTonrEmlseMBlbZmYt1chZ9/Q0RbsPLSXAXG77DJpanUoIXg6cG4vJ eZuwX/9dzGHSo6KngzWmRiS6z/T14nZODXgkmHy43qwQyBay5CRbAW1UMAXUXpwy0fra 4vIaw4j71V4qOnF8KZwioJY8nl7MaH7BVM+6dx0mKvDxb8myXGTPHY+biT0QAbw2Q3Kx N6DrO2VfYkZrS0TL6YqAtC6WnysP3PRKj308waHhQHPF6qiTu2Xr9GOYIgpiQX6lpMIm Mb2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697598537; x=1698203337; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KxDvcwRJ+oCD8R03zg9Fvuf+jD2pBmCLjGOEJlTmezU=; b=ScZSofLTUAOJSly+BIE5mRNhVqHbefxe6myAXKHfl3reVepo7KBmJx6KlwMgdIohBh kstHbUaNinTS3xt3KNIHrt1SenthY4fBAfoyPmjQcUPr3CMGKXcrlql7DdCSF1uG9uXJ cLNtwbNH+GvEg79bbSOQi53c2zNu3/aco7gRyTWzKCicvpMw6LtXw4vO4MjTkKu3VLz2 GXnkNQljmpSH8KIw+Bsji43Mh5qIQk1NofB7hZVr8HIOhXJrK/6KPDsnqyOkJNvgnKN+ 1nyUjagR4aXI+WK62b+PGnu0ly+P6XQyO5vJxcfPsbikgy66KfmJeFQftMEe+IUmYRX9 1uCA== X-Gm-Message-State: AOJu0Yy14Omoxj/2+mfS/vwj74zzXZMMT5Ay/sYjii2fKehJvo30wyvg 9ORkoXyHwo76T7dQdsFDoNr6jaymw58PHoK3tjkdwqEqj9M= X-Received: by 2002:a05:6102:303:b0:457:d682:913e with SMTP id 3-20020a056102030300b00457d682913emr4236287vsa.32.1697598537431; Tue, 17 Oct 2023 20:08:57 -0700 (PDT) MIME-Version: 1.0 References: <20231003155810.6df9de16@gandalf.local.home> <20231011114816.19d79f43@eldfell> In-Reply-To: From: jim.cromie@gmail.com Date: Tue, 17 Oct 2023 21:08:30 -0600 Message-ID: Subject: Re: [PATCH v1] dynamic_debug: add support for logs destination To: =?UTF-8?Q?=C5=81ukasz_Bartosik?= , Jason Baron Cc: Pekka Paalanen , linux-kernel@vger.kernel.org, Steven Rostedt , "wayland-devel@lists.freedesktop.org" , Sean Paul , dri-devel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 17 Oct 2023 20:09:10 -0700 (PDT) adding in Jason, not sure how he got missed. On Mon, Oct 16, 2023 at 9:13=E2=80=AFAM =C5=81ukasz Bartosik wrote: > > czw., 12 pa=C5=BA 2023 o 20:48 napisa=C5=82(a): > > > > > If you want the kernel to keep separate flight recorders I guess we c= ould > > > add that, but I don't think it currently exists for the dyndbg stuff = at > > > least. Maybe a flight recorder v2 feature, once the basics are in. > > > > > > > dyndbg has +p writes to syslog > > +T would separately independently write the same to global trace > > > > This would allow graceful switchover to tracefs, > > without removing logging from dmesg, where most folks > > (and any monitor tools) would expect it. > > > > Lukas (iiuc) wants to steer each site to just 1 destination. > > Or maybe (in addition to +p > syslog) one trace destination, > > either global via events, or a separate tracebuf > > > > Im ambivalent, but thinking the smooth rollover from syslog to trace > > might be worth having to ease migration / weaning off syslog. > > > > And we have a 4 byte hole in struct _ddebug we could just use. > > I'm glad you brought that up. This means we can leave class_id field > untouched, have separate +T in flags (for consistency) > and dst_id can be easily 8 bits wide. > > Also can you point me to the latest version of writing debug logs to > trace events (+T option). > I would like to base trace instances work on that because both are > closely related. > Ive got 3 branches, all stacked up on rc6 (last I checked, they were clean on drm-tip) https://github.com/jimc/linux/tree/dd-fix-7c the regression fix, reposting this version next. it also grabs another flag bit: _DPRINTK_FLAGS_INCL_LOOKUP https://github.com/jimc/linux/tree/dd-shrink-3b split modname,filename,function to new __dyndbg_sites section loads the 3 column values and their intervals into 3 maple trees and implements 3 accessor functions to retrieve the vals from the descriptor addresses. it "works" but doesnt erase intervals properly on rmmod it also claims another flag - _DPRINTK_FLAGS_PREFIX_CACHED and uses it to mark cached prefix fragment that get created for enabled cal= ls. https://github.com/jimc/linux/tree/dd-kitchen-sink this adds the +T flag stuff. its still a little fuzzy, esp around the descriptor arg - using it to render the prefix str at buffer-render time got UNSAFE warnings - likely due to loadable module descriptors which could or did go away between capture and render (after rmmod) > > Unless the align 8 is optional on 32-bits, > > I verified with "gcc -g -m32 ..." that the align(8) is honored on 32 bits= . > this is sorta the opposite of what I was probing, but I think result is the same. istm align(8) is only for JUMP_LABEL, nothing else in the struct appears to need it so moving it to the top trades the hole for padding. > > I think we're never gonna close the hole anywhere. > > > > :) > > > is align 8 a generic expression of an architectural simplifying constra= int ? > > or a need for 1-7 ptr offsets ? > > > > > > > > > > > > That's my idea of it. It is interesting to see how far the requirem= ents > > > > can be reasonably realised. > > > > > > I think aside from the "make it available directly to unpriviledged > > > userspace" everything sounds reasonable and doable. > > > > > > More on the process side of things, I think Jim is very much looking = for > > > acks and tested-by by people who are interested in better drm logging > > > infra. That should help that things are moving in a direction that's > > > actually useful, even when it's not yet entirely complete. > > > > > > > yes, please. Now posted at > > > > https://lore.kernel.org/lkml/20231012172137.3286566-1-jim.cromie@gmail.= com/T/#t > > > > Lukas, I managed to miss your email in the send phase. > > please consider yourself a direct recipient :-) > > > > thanks everyone > > > > > Cheers, Sima > > > -- > > > Daniel Vetter > > > Software Engineer, Intel Corporation > > > http://blog.ffwll.ch