Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6348950ybi; Wed, 31 Jul 2019 12:45:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzoaMqFP5S57sDCKw98yJWeujV7r8zaaHz/ZGkpB21ze59EsFaR2PWRbEYKiQlbRbXTpmfE X-Received: by 2002:a17:902:5985:: with SMTP id p5mr25639236pli.177.1564602301227; Wed, 31 Jul 2019 12:45:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564602301; cv=none; d=google.com; s=arc-20160816; b=vVbf9lS32F6h9NTRtHuaNf5zRnpJsZ/E2o8C+U0EoJ5V2RQjxkDK8FzkH+BYLgtdIL 3gmWIRrHtrmsRbm7Z0ixUgKMNuIsTg28b4Kdn7xSNA/H2bGwUClp+rmOWV4p3VQpcA00 vgibf6iQGX+FALeZST/wCe+1UsjSlCYX/7MjHB8xKH8loMc7jABMMBFkC7qitRU9W5oj YwlJ2W0IWJvn/IzEfzPu/YUnXylaU/hh30mWCtu2RL1l9oOLvPfX5awYRtx60daFVIlU xWv3BYmBJVBp+3R83equ3ywDtoEfP8q3n8Ug4DgT5nbGPxHV5QP77vJiuowjYE7G4MUD Z22A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=xVQ8t8gbP6SYIxM1VbTd3SexPudKtMT7Cp4SCdoasEA=; b=gSlx4Js6DGAxve6HJvLjAv+le2SHJygM53x67xIIzU8L9DL7Mk5YbG2PYsMhX/y6Vh hdmC+AbDJTtpx227Jb76XBdHXHDozggJlVkbMyyIavhP+45UZjnnh8zhFB4XxKdnI3sG iIduW++jHyfgoABP5Res64firdkU/KlBdbxVvXW0peOrBLAx33CXMOJm8BnxIZW7XN6Q baw8gdj0zrqDm+GlN+H2oV4qlWPywVxQr8rqTZHVlx8ptExwSFoW4u7DbblCc3/W1e77 9c2BG71DDZsjNvTNxKkjTCgETzY0SOrMdu15GHM/g/UpVTyAnxtntLWqyhENpjDxxawt kLnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s7si33317365plp.66.2019.07.31.12.44.45; Wed, 31 Jul 2019 12:45:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729661AbfGaSYj (ORCPT + 99 others); Wed, 31 Jul 2019 14:24:39 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:7789 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726469AbfGaSYi (ORCPT ); Wed, 31 Jul 2019 14:24:38 -0400 Received: from sc9-mailhost2.vmware.com (10.113.161.72) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Wed, 31 Jul 2019 11:24:33 -0700 Received: from rlwimi.localdomain (unknown [10.166.66.112]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 064B4B2841; Wed, 31 Jul 2019 14:24:36 -0400 (EDT) From: Matt Helsley To: LKML CC: Ingo Molnar , Steven Rostedt , Matt Helsley Subject: [PATCH v4 0/8] recordmcount cleanups Date: Wed, 31 Jul 2019 11:24:08 -0700 Message-ID: X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII Received-SPF: None (EX13-EDG-OU-002.vmware.com: mhelsley@vmware.com does not designate permitted sender hosts) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org recordmcount presents unnecessary challenges to reviewers: It pretends to wrap access to the ELF file in uread/uwrite/ulseek functions which aren't related the way you might think (i.e. not the way read, write, and lseek are releated to each other). It uses setjmp/longjmp to handle errors (and success) during processing of the object files. This makes it hard to review what functions are doing, how globals change over time, etc. There are some kernel style nits. This series addresses all of those by removing un-helper functions, unused parameters, and rewriting the error/success handling to better resemble regular kernel C code. -- This series was formerly part of a v3 posted under the subject "Cleanup recordmcount and begin objtool conversion". I am reposting it split into two series: these cleanups of recordmcount and a second series that begins the conversion of the cleaned-up recordmcount into an objtool subcommand called mcount. v4: Addressed feedback on v3 from Steven Rostedt: Moved already_has_mcount into recordmcount.c to avoid unnecessary multiple definitions. Changed return semantics of find_secsym_ndx() to avoid need for missing_sym (and multiple definitions) and to separate the returned symbol info (value, index) from success/failure indication. Fixed up local variable declaration to follow inverted christmas tree style. Matt Helsley (8): recordmcount: Remove redundant strcmp recordmcount: Remove uread() recordmcount: Remove unused fd from uwrite() and ulseek() recordmcount: Rewrite error/success handling recordmcount: Kernel style function signature formatting recordmcount: Kernel style formatting recordmcount: Remove redundant cleanup() calls recordmcount: Clarify what cleanup() does scripts/recordmcount.c | 321 ++++++++++++++++++++--------------------- scripts/recordmcount.h | 150 +++++++++++++------ 2 files changed, 259 insertions(+), 212 deletions(-) -- 2.20.1