Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp344487pxb; Sat, 11 Sep 2021 06:55:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1tGcOWg3jgVu605llfihQRqfZq+qhAs1XCG18EIWx96IIl6LMTgCDy0PaNb5WFVOWi4ws X-Received: by 2002:a05:6402:221b:: with SMTP id cq27mr3391683edb.374.1631368517827; Sat, 11 Sep 2021 06:55:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631368517; cv=none; d=google.com; s=arc-20160816; b=Fxf8ES+rd/AWd5QPJ7HqrE7y+Z1QkRppPYS9cqX2xr8/fSMQlQGulU29GdW0obsMaq ianmitw7tSrzMtl2KeiLHsAYtMXzYpnWxiTX4P1evImk+QSS8o2omolT5rYMzGfIpstY tob+p8yFOAxUehmbjMBuC8PVMDMKJc3rPi8LG9yZSCfezjBT56xXMMG8ukvnQLEzwGWK z8o6RLaksMC66HSVY90qAT1Rba4EW53hAz7aOIHGwHMLR975yzUyV42DctB6QJMcPEw+ n/24X/ODl3u2AcJHcMQzNFpUaP1wE2OsoNzaoP8rfL1yWHTx1K2INuEPb2DXQx/BC66m x5dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from; bh=SPjEnMuBE5VUvGv14asKgK0yvIj9vt8HL85iX7Ewins=; b=LGVCwCDqOsGTSQfl/vkUals0UVvwmiOEvHZNUtc4sFquFe43E2KvdSmP2/iLC4FmV8 tngCBTgrsIAhtKm+/e3UJ+YiSE/hCVXWeiJqel1U1i0yImKDybBVRVreYzjtC5RxfFX4 B2MCy9lFHMxIzZ6YKnHOhnJmRTJpu/ZvTLWu8rRdFp1BVAnFP5uqRvwjklsCnbKfj7x8 KIrvz7Y5uFBG1O/NBX5MxfjJpLSRbSUXe93BYF3tmCxyB+9l6UHBaJl+Ftxj0ty83VNH uw3M2eS++0210+cz4vwiYo/6sf/j/QP3joHEH+UvRcMR+OPhnLgqhF/2cHo7iYtY7AQZ zelQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v1si1770607edc.180.2021.09.11.06.54.39; Sat, 11 Sep 2021 06:55:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235809AbhIKNwT (ORCPT + 99 others); Sat, 11 Sep 2021 09:52:19 -0400 Received: from out30-131.freemail.mail.aliyun.com ([115.124.30.131]:58241 "EHLO out30-131.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230249AbhIKNwS (ORCPT ); Sat, 11 Sep 2021 09:52:18 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=yinan@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0Uo-HHX6_1631368260; Received: from localhost(mailfrom:yinan@linux.alibaba.com fp:SMTPD_---0Uo-HHX6_1631368260) by smtp.aliyun-inc.com(127.0.0.1); Sat, 11 Sep 2021 21:51:03 +0800 From: Yinan Liu To: yinan@linux.alibaba.com, rostedt@goodmis.org, mark-pk.tsai@mediatek.com, peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org Subject: [PATCH 0/2] ftrace: improve ftrace during compiling Date: Sat, 11 Sep 2021 21:50:41 +0800 Message-Id: <20210911135043.16014-1-yinan@linux.alibaba.com> X-Mailer: git-send-email 2.14.4.44.g2045bb6 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Some business scenarios require the kernel to start as quickly as possible, so recently we are optimizing some processing during the kernel startup phase. When the kernel is started, ftrace_init() takes 15-20ms to execute. Almost all of the overhead belongs to the sorting and replacement of nop instructions, and other processing only accounts for about 300us. Advance the processing of these two parts to the compile time, and the time saved is very important for certain scenarios, such as the quick start of containers. Yinan Liu (2): scripts: ftrace - move the sort-processing in ftrace_init to compile time scripts: ftrace - move the nop-processing in ftrace_init to compile time kernel/trace/ftrace.c | 9 +++- scripts/link-vmlinux.sh | 6 +-- scripts/recordmcount.h | 14 +++++++ scripts/sorttable.c | 2 + scripts/sorttable.h | 109 +++++++++++++++++++++++++++++++++++++++++++++++- 5 files changed, 133 insertions(+), 7 deletions(-) -- 2.14.4.44.g2045bb6 +++++++++++++++++++++++++++++++++++++++++++++++-