Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp224388rdh; Wed, 7 Feb 2024 03:01:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IH6RF2uVR8f1fndaeNN81dQ7jVi1StZbsmK1GLoWuqVSIBCkibP1+Icp1yI+UPbXaP7tWYH X-Received: by 2002:a05:620a:21c4:b0:785:4de3:2027 with SMTP id h4-20020a05620a21c400b007854de32027mr5210026qka.77.1707303669208; Wed, 07 Feb 2024 03:01:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707303669; cv=pass; d=google.com; s=arc-20160816; b=OsXD2kMh8B9A5PTrC2TpWLEwXlhfA/1VQu7x9Cb2E3ETrjpYn2bcW/VcNHuYg9VmQ4 rVcPgnd3NZtYmN9/dbFH7rgYn8DBhw7tYA2isbz5qbiYCUzV893N6PjfOI0+NFovtJgp nNGwtfkI55VEEH14vehIvsqIdLdhFkPR8CMeHLggnjZ1FjFbLmdZi+GOIOzmaWaRJXeh NTpTKTlW8qoOP3dtZnhP6IQMK7Cj/d39PMllU+eThGv0sQUFG6WX0MJTlIcUAMpqiXsk LhVbwAJx4iSgKQWNAg4LU+exsL+JJYWkIBKMgTShj0TzdHizGkOT1lr3w8E3UoNCcXv/ eLdA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=eyUiwpFluA7WcMFlIVSpAKe54wAT0z8+m/oRT7nE+0Q=; fh=NiZk9URwF/FB26NVBUrGtevMto5tgYvaC6gM6PE/TNU=; b=AVUe6vUywuAy0xxjEPKolITbEWz63HNQsIzFQ+4L+dHx6ZDOgjmIaKo+FHEH/PRl0H 8dIXNGr15tB6CdzR34nCSajC5vafMuxLmtMBZoo3RrBXd1shcmHRxHc7WWP/AHV1enNl sRLEpeUoRJw7fOccOqqfWr7KKuLELes4gjzzhcVNaadpYCbOKY5mZyHp7xp38IfBcpFU hAKUpOBBhFqqwL20ggXLS5ujzFzWOjzzFQjzi5kbzBx1m1UwG6VvU0PWvHvJ8N4dT2eK U9nXxYlStcNmar0PxIu4MPdu7+685F2hU/9DCYeE/SKGAfA5D3BHR2UCXbUCmEwLxzdb JSIA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=LGf89IfT; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b="TYvli/OI"; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=LGf89IfT; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-56354-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56354-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCUFzipwNI6rZ0hG5tM97WxBx4as2VOi5HqD4IMfhdCWMzksbQtPxFrXI9Q9N9jisxaM4DuqbBQ+wxY6lKyv1BzJGsH3L0th2b6XUUXmRQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a15-20020a05620a16cf00b00783cc18b28bsi819768qkn.565.2024.02.07.03.01.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 03:01:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56354-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=LGf89IfT; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b="TYvli/OI"; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=LGf89IfT; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-56354-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56354-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8E43F1C24FE2 for ; Wed, 7 Feb 2024 11:00:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 488541805E; Wed, 7 Feb 2024 11:00:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="LGf89IfT"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="TYvli/OI"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="LGf89IfT"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="TYvli/OI" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8BCB017BCB; Wed, 7 Feb 2024 11:00:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707303648; cv=none; b=FbmB6Eh426Q7hjprX1wJqxgqLWEwER89AG4W9hhOa7zCkrY8x/n0fFB6JgA9YL8PLAVVzNt5iTwn+R+pmO+iB3Xzm0eXVgcPKioCAp+ifJCxKZbvnSbIfXG6p/G/Q3rRu1VQ8GGBN41SzXWZOp4HdLbk0N8nEFDksTAfzeeP2gI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707303648; c=relaxed/simple; bh=FFSAnBd5Se93bT02HPMvL2EH82+uilSJf/jAlwQuULE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mTUCHyYiaFbgxufYSBNdpNBFOYo2pn3kBAhtI/D8o0Qd3eO9ircNs8s/nhyN5riorUXrnNOS9Xm0zQiZ0sTWJlOubmuP9cX1szZYCJa6vig0NUmg5ZHSLJz69o23tZGQZH1cZvbskHTw2UU5miA63fdhMqi9PWFNFBI3935qd4I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=LGf89IfT; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=TYvli/OI; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=LGf89IfT; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=TYvli/OI; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BDFE51F74D; Wed, 7 Feb 2024 11:00:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1707303644; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eyUiwpFluA7WcMFlIVSpAKe54wAT0z8+m/oRT7nE+0Q=; b=LGf89IfTA4RVcerXsbYRkgZvIaDnx484T5e21bRXDAxjPZ1Rj5njN4gOw2gf3Q/1Ma0Z/B lcgkvOTxmn5AATSG3UusBAqGNblM+oJQoUPtkBYhDWwU9z3NATXxFmfJNro1hx3k+oE7xm fhv76d0M5AAparRnA4c4TKnB/z9/0AE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1707303644; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eyUiwpFluA7WcMFlIVSpAKe54wAT0z8+m/oRT7nE+0Q=; b=TYvli/OIyXnEaUcCET9zbyUu8hu+WhCALgJU8+TvZEJSTslC16szgwtHE/P0B90QfwfBmK 0HCbcgpDxcRq80DQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1707303644; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eyUiwpFluA7WcMFlIVSpAKe54wAT0z8+m/oRT7nE+0Q=; b=LGf89IfTA4RVcerXsbYRkgZvIaDnx484T5e21bRXDAxjPZ1Rj5njN4gOw2gf3Q/1Ma0Z/B lcgkvOTxmn5AATSG3UusBAqGNblM+oJQoUPtkBYhDWwU9z3NATXxFmfJNro1hx3k+oE7xm fhv76d0M5AAparRnA4c4TKnB/z9/0AE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1707303644; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eyUiwpFluA7WcMFlIVSpAKe54wAT0z8+m/oRT7nE+0Q=; b=TYvli/OIyXnEaUcCET9zbyUu8hu+WhCALgJU8+TvZEJSTslC16szgwtHE/P0B90QfwfBmK 0HCbcgpDxcRq80DQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id B29C0139D8; Wed, 7 Feb 2024 11:00:44 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id oz2TK9xiw2UscQAAD6G6ig (envelope-from ); Wed, 07 Feb 2024 11:00:44 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id BBE1EA0809; Wed, 7 Feb 2024 12:00:41 +0100 (CET) Date: Wed, 7 Feb 2024 12:00:41 +0100 From: Jan Kara To: Miklos Szeredi Cc: lsf-pc , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [Lsf-pc] [LSF/MM/BPF TOPIC] tracing the source of errors Message-ID: <20240207110041.fwypjtzsgrcdhalv@quack3> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -0.82 X-Spamd-Result: default: False [-0.82 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.02)[53.73%] X-Spam-Flag: NO On Wed 07-02-24 10:54:34, Miklos Szeredi via Lsf-pc wrote: > [I'm not planning to attend LSF this year, but I thought this topic > might be of interest to those who will.] > > The errno thing is really ancient and yet quite usable. But when > trying to find out where a particular EINVAL is coming from, that's > often mission impossible. > > Would it make sense to add infrastructure to allow tracing the source > of errors? E.g. > > strace --errno-trace ls -l foo > ... > statx(AT_FDCWD, "foo", ...) = -1 ENOENT [fs/namei.c:1852] > ... > > Don't know about others, but this issue comes up quite often for me. Yes, having this available would be really useful at times. Sometimes I had to resort to kprobes or good old printks. > I would implement this with macros that record the place where a > particular error has originated, and some way to query the last one > (which wouldn't be 100% accurate, but good enough I guess). The problem always has been how to implement this functionality in a transparent way so the code does not become a mess. So if you have some idea, I'd say go for it :) Honza -- Jan Kara SUSE Labs, CR