Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3218186pxj; Mon, 10 May 2021 22:33:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzknTbLagf2pkJhg6ZBZyYNnVum1Gh6rarC5vRA2zTuP0r6wyPt9c111lRCj/afQerLtJND X-Received: by 2002:a92:c750:: with SMTP id y16mr16671328ilp.149.1620711189591; Mon, 10 May 2021 22:33:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620711189; cv=none; d=google.com; s=arc-20160816; b=jVXyXSkSX/7TCD1gxW5DPAnF3aGr4ImLuXJfrnGYlZ5BWHy34vjBUdLvA5ZTu7bADe 1BmulpEJiN71Cz+yTQRoSf7qCfBW+r5D2aJ/E2a+3PpR2Fq1n7I84SntF10DjShgZJcL l0sGukZyT3QM9m2ANfIz/zTFk7QVp+6db26fJwqwymB5wr/FdT5QLx13C8adzqeaQryG o05STNTn1TNv9VKborBlBpT3iMtXzRYmyP0PFBgiJURyEe3TEXsIhGyogpSSKjXgNzTU Tq4JQ9En6+TMxZfU3SGiBl6Tzj9DOcCWJwwqESUluhOhluK3WZJhVdBXSz7oY0186qHB QZzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=dCZrRM3udZJBNFXFYYKzBZqfQzOH2s+IIGlUraUh5YE=; b=YJPXCnXbRfrJwaWK+BjSoCp3eSl2dYuzmHH39k/JajGIH7g1P7OFBZ5WOJqOpQsGjR 69odhgHpijDM/PplVMtiRprTBpo1Uea5koYoISpUONiegUGeqQZmPS1O/3k+sZu9AwjC AuSuCG6KiL3/EntkAmGv0jUwc2rElS4S9+h/MYwMKZ4FK4K9tOVostkPa+V9KQ3RTiIk oAIkMrx73GQ8WO+ZinweenSnij1G92ZBJdQpCTvjQEQmMd5BetMsiykdJpEq/gPKGEWA YSaVwePdpHmAdUFqPvTeK53d+OigWDeetrS4V70x414gIWsBvTHIIoxYRuUWB+kcKc03 TVpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gkK9qSTR; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q14si18780316ilg.14.2021.05.10.22.32.57; Mon, 10 May 2021 22:33:09 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gkK9qSTR; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230216AbhEKFdA (ORCPT + 99 others); Tue, 11 May 2021 01:33:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229925AbhEKFc7 (ORCPT ); Tue, 11 May 2021 01:32:59 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDEF2C061574 for ; Mon, 10 May 2021 22:31:53 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id c22so21348294edn.7 for ; Mon, 10 May 2021 22:31:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dCZrRM3udZJBNFXFYYKzBZqfQzOH2s+IIGlUraUh5YE=; b=gkK9qSTRgN2c9OERNxvdGwa7fWng8sUpLFAl6LfivJoG3qvSNUWIeoWOWyOAnBlwon +nBxGW+OltHMXxDrxMYxG2ZT8veHHz71TgmRAMLczL7gfL0vivud496HTvuB1ORuBKuP OpnxG8OPfyZLyc5HJ7xJbfd88G/OC+RigjAt5Zb+ml+kviRbrxRALWCKtw4w1m2oY4AL hKEUJyi0/qs/tp1DWL4eGMja5Sdd7iA1N4hlg9DXEE6fApLElJUUTTVjZaoktP9yRjHo 708OM7o7UwXtDd82sJj2PoYTFPwjgaJLllhdqs9mODFbnaQ8yP9gR3D8FxDa763UN2v0 OyVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dCZrRM3udZJBNFXFYYKzBZqfQzOH2s+IIGlUraUh5YE=; b=draZuXdS6Ya2s7OcjQsvieK2K19y2kTRhZhv7N+DD5Ckavsdfh04/6uKkE/9Ii8unt IxhbKCoy2ShLprk5mTbxGYzI2nx67oG9kuDuYLLFI9DNMQ5HSx/lgau6hUohRap48jck n0JbO8HepEFhmnhaC3dV41yjvCw+LrFhF4XJj6awK/WhCQfuNmZIdXVuTyffpao5+QlV wcK1puMmqOwYRpc7d6+s85klQqiPJmc/7jITWEj+bQLWbd1y95DXt3e8Rg6StRagKcm1 u/hyv2l+Wmx3nJ7Qxva0e3EP0Bs4AjCCZKCHf13KwlvUbwoZl6QSiXVHnQULa+7UvACQ gLKg== X-Gm-Message-State: AOAM533XEdcCxk9HBP8BXvt9F4OaaGl3LeForJWLmYg1FjWnEv4GjdZj ZW+U1cBxKXPVHAMYpJjQgGMN+4uRH1wkO/1WZjEFsdBQlH3DCTGV X-Received: by 2002:aa7:d952:: with SMTP id l18mr33295592eds.83.1620711112526; Mon, 10 May 2021 22:31:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Shivank Garg Date: Tue, 11 May 2021 11:01:36 +0530 Message-ID: Subject: Re: Profiling execution time for __alloc_pages_nodemask To: Yang Shi , David Hildenbrand Cc: Linux MM , Andrew Morton , Linux Kernel Mailing List , gregkh@linuxfoundation.org, sergey.senozhatsky@gmail.com, pmladek@suse.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >Are you maybe calling ktime_get() too early during boot, where some >subsystems are just about to be brought up? Thanks David, I guess this is the issue. >Is there any reason that prevents you from using some advanced tools, >i.e. perf, bcc/bpftrace, etc? They are much simpler than adding >instrumentation in kernel. Actually, I want to record the arguments for the memory allocator and filter out the calls I don't need (which are creating noise). For instance, I'm only interested in particular order and flags. This is the reason I added my custom tracepoint, which theoretically looked easy to implement without adding much overhead. Thanks, Shivank On Tue, May 11, 2021 at 5:30 AM Yang Shi wrote: > > On Mon, May 10, 2021 at 7:57 AM Shivank Garg wrote: > > > > Hi Everyone! > > > > I want to profile the time taken to execute the __alloc_pages_nodemask > > for different linux configurations/parameters. > > To measure the execution time, I use the ktime_get() apis. I get the > > ktime_get() on the top, and I want to do ktime_sub(ktime_get(),ktime) > > and record it in a tracepoint. > > However, the patch on implementation prevents the kernel from booting > > up. I debugged the bug to find out that the issue recurs on adding > > ktime_get() inside the __alloc_pages_nodemask path. So, that the > > kernel fails to boot up ( and show the blank screen without any logs ) > > I'm using the Linux kernel 5.6.13 (5821a5593fa9f28eb6fcc95c35d00454d9bb8624) > > Is there any reason that prevents you from using some advanced tools, > i.e. perf, bcc/bpftrace, etc? They are much simpler than adding > instrumentation in kernel. > > > > > Is it an expected behavior? or a BUG? Has anyone else faced the same issue? > > > > Can you please suggest, what would be a good way to measure execution > > time for page allocation (if not ktime_get) > > > > Stay Safe! > > Best Regards, > > Shivank Garg > > Open-Source Enthusiast and Student, IIT Kanpur > >