From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@cse.psu.edu Subject: Re: Error reporting (Was: [9fans] GNU Make) From: Charles Forsyth Date: Thu, 3 Jun 2004 15:58:41 +0100 In-Reply-To: <62e4022c76189277635e462989273aaf@vitanuova.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-njiylrfxrbhwgebyqrqgthxowt" Topicbox-Message-UUID: 93650b30-eacd-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-njiylrfxrbhwgebyqrqgthxowt Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit i think i might have used strstr. ok, i suppose you might have a file with 'does not exist' in its name, but i can't say i lose much sleep over it. could use strqstr to look outside quotes i suppose. also, in term% ls /sys/src/cm/db ls: /sys/src/cm/db: '/sys/src/cm/db' does not exist if it were ls: /sys/src/cm/db: file does not exist: '/sys/src/cm/db' i'd find it a little odd to read, myself, although again i can't get too worked up about it. in APE's case i suspect i'd settle for putting the most common error strings at the front, on the grounds that most applications stop processing once an error occurs anyhow, except for access/open/exec/stat when used to search for something. (so do the check for `does not exist' or `no permission' early.) is this worry the result of having profiled something important? i vaguely remember from my time fighting it that gcc's cpp causes the computer to wade through pages of filth to get anywhere when doing the search lists for #include but there's much more to slow you down in that thing. perhaps like Linus's scheduler someone has finally done the decent thing? anyhow: IS there a real cause to worry about APE's string -> errno translation speed based on (say) a profile of an application, or is it conjecture? --upas-njiylrfxrbhwgebyqrqgthxowt Content-Type: message/rfc822 Content-Disposition: inline Received: from mail.cse.psu.edu ([130.203.4.6]) by lavoro; Thu Jun 3 15:14:48 BST 2004 Received: from psuvax1.cse.psu.edu (localhost [127.0.0.1]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id C171B19BE6 for ; Thu, 3 Jun 2004 10:13:35 -0400 (EDT) X-Original-To: 9fans@cse.psu.edu Delivered-To: 9fans@cse.psu.edu Received: from localhost (neuromancer.cse.psu.edu [130.203.4.2]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 9AB0619B14 for <9fans@cse.psu.edu>; Thu, 3 Jun 2004 10:13:13 -0400 (EDT) Received: from mail.cse.psu.edu ([130.203.4.6]) by localhost (neuromancer [130.203.4.2]) (amavisd-new, port 10024) with LMTP id 27283-02-8 for <9fans@cse.psu.edu>; Thu, 3 Jun 2004 10:13:11 -0400 (EDT) Received: from smtp.vitanuova.com (unknown [62.254.170.97]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id B554A199F2 for <9fans@cse.psu.edu>; Thu, 3 Jun 2004 10:13:10 -0400 (EDT) Message-ID: <62e4022c76189277635e462989273aaf@vitanuova.com> To: 9fans@cse.psu.edu Subject: Re: Error reporting (Was: [9fans] GNU Make) Date: Thu, 3 Jun 2004 15:19:21 +0100 From: rog@vitanuova.com In-Reply-To: <0cb1cff0f6c4661c7af319469e1f7c7c@terzarima.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-qjpzgfqamizweevmlpzhbupame" X-Virus-Scanned: by amavisd-new at cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: 9fans-bounces+forsyth=terzarima.net@cse.psu.edu Errors-To: 9fans-bounces+forsyth=terzarima.net@cse.psu.edu This is a multi-part message in MIME format. --upas-qjpzgfqamizweevmlpzhbupame Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit > i assume because it reads better, in english anyway this is a pity. i think something like: file does not exist: '/usr/rog/dvfgfdds' is just as readable, and adheres to the usual convention for cascading of error messages (most to least recent; truncation can occur at the end if necessary). it is sometimes necessary to have a program distinguish between error messages, and the way i've seen some programs deal with the current convention: n = sizeof " does not exist" - 1; if(strlen(e) > n && strcmp(strlen(e)-n, " does not exist")){ /* file does not exist */ } is just wrong. --upas-qjpzgfqamizweevmlpzhbupame Content-Type: message/rfc822 Content-Disposition: inline Received: from mail.cse.psu.edu ([130.203.4.6]) by doppio; Thu Jun 3 15:03:43 BST 2004 Received: from psuvax1.cse.psu.edu (localhost [127.0.0.1]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 6D2DC19DFE for ; Thu, 3 Jun 2004 09:58:08 -0400 (EDT) X-Original-To: 9fans@cse.psu.edu Delivered-To: 9fans@cse.psu.edu Received: from localhost (neuromancer.cse.psu.edu [130.203.4.2]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 2238119A63 for <9fans@cse.psu.edu>; Thu, 3 Jun 2004 09:57:36 -0400 (EDT) Received: from mail.cse.psu.edu ([130.203.4.6]) by localhost (neuromancer [130.203.4.2]) (amavisd-new, port 10024) with LMTP id 27784-01-57 for <9fans@cse.psu.edu>; Thu, 3 Jun 2004 09:57:34 -0400 (EDT) Received: from lavoro.terzarima.net (spc1-york1-5-0-cust44.seac.broadband.ntl.com [80.0.45.44]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 232E819DE9 for <9fans@cse.psu.edu>; Thu, 3 Jun 2004 09:57:34 -0400 (EDT) Message-ID: <0cb1cff0f6c4661c7af319469e1f7c7c@terzarima.net> To: 9fans@cse.psu.edu Subject: Re: Error reporting (Was: [9fans] GNU Make) From: Charles Forsyth Date: Thu, 3 Jun 2004 14:54:01 +0100 In-Reply-To: <4a8f5dee0a8d8ba7be23785692dd2317@vitanuova.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-kjxrucklxhyfmftgvdfaaeuoqs" X-Virus-Scanned: by amavisd-new at cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: 9fans-bounces+rog=vitanuova.com@cse.psu.edu Errors-To: 9fans-bounces+rog=vitanuova.com@cse.psu.edu This is a multi-part message in MIME format. --upas-kjxrucklxhyfmftgvdfaaeuoqs Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit i assume because it reads better, in english anyway --upas-kjxrucklxhyfmftgvdfaaeuoqs Content-Type: message/rfc822 Content-Disposition: inline Received: from mail.cse.psu.edu ([130.203.4.6]) by lavoro; Thu Jun 3 14:57:06 BST 2004 Received: from psuvax1.cse.psu.edu (localhost [127.0.0.1]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 4513A19E46 for ; Thu, 3 Jun 2004 09:55:50 -0400 (EDT) X-Original-To: 9fans@cse.psu.edu Delivered-To: 9fans@cse.psu.edu Received: from localhost (neuromancer.cse.psu.edu [130.203.4.2]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 7EE6119DE9 for <9fans@cse.psu.edu>; Thu, 3 Jun 2004 09:55:38 -0400 (EDT) Received: from mail.cse.psu.edu ([130.203.4.6]) by localhost (neuromancer [130.203.4.2]) (amavisd-new, port 10024) with LMTP id 27777-01-50 for <9fans@cse.psu.edu>; Thu, 3 Jun 2004 09:55:37 -0400 (EDT) Received: from smtp.vitanuova.com (unknown [62.254.170.97]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id AD42219A63 for <9fans@cse.psu.edu>; Thu, 3 Jun 2004 09:55:36 -0400 (EDT) Message-ID: <4a8f5dee0a8d8ba7be23785692dd2317@vitanuova.com> To: 9fans@cse.psu.edu Subject: Re: Error reporting (Was: [9fans] GNU Make) Date: Thu, 3 Jun 2004 15:01:47 +0100 From: rog@vitanuova.com In-Reply-To: <4b34059e61c4f6071f83af2fb750cfe3@proxima.alt.za> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: 9fans-bounces+forsyth=terzarima.net@cse.psu.edu Errors-To: 9fans-bounces+forsyth=terzarima.net@cse.psu.edu > you return the %r chunk and then hash it into an associative array of translated messages, indexed by hash. no you couldn't, 'cos the kernel adds a filename for some error messages. was there a good reason why the filename was put in front of the error message rather than vice versa? it seems odd - it means you have to parse the error message, rather than just doing a strncmp, and you don't have to worry too much about the filename being truncated at the end. --upas-kjxrucklxhyfmftgvdfaaeuoqs-- --upas-qjpzgfqamizweevmlpzhbupame-- --upas-njiylrfxrbhwgebyqrqgthxowt--