From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIM_ADSP_ALL,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 365F7C433E0 for ; Sat, 4 Jul 2020 17:16:32 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7938320737 for ; Sat, 4 Jul 2020 17:16:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (4096-bit key) header.d=valentin-vidic.from.hr header.i=@valentin-vidic.from.hr header.b="sNxPEdb9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7938320737 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=valentin-vidic.from.hr Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces+kernelnewbies=archiver.kernel.org@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94) (envelope-from ) id 1jrlmA-0003Sg-9r for kernelnewbies@archiver.kernel.org; Sat, 04 Jul 2020 13:16:30 -0400 Received: from valentin-vidic.from.hr ([2001:470:1f0b:3b7::1]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1jrlkM-0001vP-19 for kernelnewbies@kernelnewbies.org; Sat, 04 Jul 2020 13:14:38 -0400 X-Virus-Scanned: Debian amavisd-new at valentin-vidic.from.hr Received: by valentin-vidic.from.hr (Postfix, from userid 1000) id 16CA22F41; Sat, 4 Jul 2020 19:14:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valentin-vidic.from.hr; s=2020; t=1593882874; bh=n6+S7+q9dm2+9EFPPpnwwkNDRISo8pIsgNiHkcO7zqY=; h=Date:From:To:Subject:References:In-Reply-To:From; b=sNxPEdb9xVrcGXRBJJhylNFe2Z9HHwRl4mPDCX73BqPEZOXz9IDjSwog0qcmrfaPo SuRM4aQCgqb96B5e4vVBBAEYgEY5OstKfhDvzzMnPwaBGXmpkbZqzzNM1bRi+6TMo2 +53CYB1esb2KvhSw2AHB+XN72LjjWZ/SbXtMNfu5MYJJL2Y6keAGGqjD076xfLiOoM YQ/ZyKuqbCJtT6GLY7A3IeMLymJpMtjOWnkNyD4a7EHQYdsY3NaScV+mx0vTU8b5/s tAsqM3ceVPVlRnNfEj33rQ08SIZfbcAxB6tAq+xWbii5N50XqOeuqBEjc3Cyde9btQ sPpxJR1Ku6oJmoKDt6Kp3sDai90tpFSVHJSG8bYKiTMm/mjtI9Jml9rw1lZcg4enKa CykdK1R9TOx77Zic7VeBD9RRpTz3EYXbOqy6t1ZZgf319/OwZLvEQpm0k96aTKClN9 0nMMwldOyMqYrPJ9owpQu651amd5+b8YakGyiRMsaQ8CCg5x/4HPJU4q4p3fE6d5Zu U9vSChd6EyGbxWL5hGU8/3tlwvcXK5Nc2R6b44lhp2zJmVX3DezfdZ118CVV4IHMAg 4Ueg4qqEvi0nsb9E9QLJcnIEAsHomzObbhQO9bDiRpN93X+Xny5bfZL30sCt5h+1en Ut1Smr0N0qGh+5j2+aQqz+u4= Date: Sat, 4 Jul 2020 19:14:34 +0200 From: Valentin =?utf-8?B?VmlkacSH?= To: kernelnewbies@kernelnewbies.org Subject: Re: printk() format %pS wrong symbol Message-ID: <20200704171433.GD6573@valentin-vidic.from.hr> References: <20200704102910.GA6573@valentin-vidic.from.hr> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces+kernelnewbies=archiver.kernel.org@kernelnewbies.org On Sat, Jul 04, 2020 at 12:04:59PM -0400, William Tambe wrote: > How or which function within that file translates an address to the string > symbol+offset for the format %pS ? %pS seems to end up in here: static int __sprint_symbol(char *buffer, unsigned long address, int symbol_offset, int add_offset) { char *modname; const char *name; unsigned long offset, size; int len; address += symbol_offset; name = kallsyms_lookup(address, &size, &offset, &modname, buffer); if (!name) return sprintf(buffer, "0x%lx", address - symbol_offset); if (name != buffer) strcpy(buffer, name); len = strlen(buffer); offset -= symbol_offset; if (add_offset) len += sprintf(buffer + len, "+%#lx/%#lx", offset, size); if (modname) len += sprintf(buffer + len, " [%s]", modname); return len; } -- Valentin _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies