Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp483076pxu; Thu, 7 Jan 2021 09:45:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHRmmpOhF3h7oMMDmqXMsdy4nghtRz6tCrSo09Mf16lW/NlRyPOwnnpSK7vzmZmY3NLMzV X-Received: by 2002:a17:906:9452:: with SMTP id z18mr7191925ejx.389.1610041550091; Thu, 07 Jan 2021 09:45:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610041550; cv=none; d=google.com; s=arc-20160816; b=tKFGx5SD6FHMWdL2KMalAuMW19NMYvc75hV5LF4cjY2JkU4CwO8I7rX2hFc7iVUO9g OGGJnoQUj0Nn5HgqHVfIzhItFHhYhpFV+9y86HWgi+3N737Dcp8t74yRd79KCrcapiCU 3xZQK1NDuCUbIwCyzLrtSYDOuCnD/2P2I7C2l+7GBs8xqpVzimBnMgWtPJjxnBlxL6wN dJoB56FL4x0hmD6RRPf5VrRng/5RL6pail1YFDy7gvq7/DcJcPTD0ucM/S+IRSypNLvc blVzsLnisz4vH+Vs9rsrByAoGjAlEqwgL6riM0Jy/hxb8r1T5vPB0zWxiMMXkpS0ZPkS c9Fg== 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=LRqxwEPJISEBHpjqZE2l6FmdiTZQs0jM9TpD8cQN+YA=; b=USeBEUe2Ocs9Ehdux04cPf4NntdEBb9A/L+hM8z3LjdHeVmE/8xXPTp/HOn2VwHHDV kJGveuERf+aNwpy7pHeN2c7vtp/8quVq/abW5SC+gnPCp5Q00B6jcHJB0388gezykIaR 1I0NMHYdX4t0Mk4e6p84k964RrUFJ0HT5KHQbkEpTJOyJ2c8ptIaLNKGYTAqFZROVWHf libg/MN/QlC8nOMt7wXPmszyzdAebBa1pTjCahEvpTy/0f6SO4nqo6QahsLEyf6oK0Ut 21NFA5VcVBLm4I79UxRGInl6C8m2c/n+RcC/1FT1CGcJmnCdBie+b0fcPhh0c31MvtF2 5bSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=V0YYF8gW; 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=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a21si2587170eda.110.2021.01.07.09.45.26; Thu, 07 Jan 2021 09:45:50 -0800 (PST) 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=@cloudflare.com header.s=google header.b=V0YYF8gW; 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=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729089AbhAGRn3 (ORCPT + 99 others); Thu, 7 Jan 2021 12:43:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728008AbhAGRn3 (ORCPT ); Thu, 7 Jan 2021 12:43:29 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 814C3C0612F6 for ; Thu, 7 Jan 2021 09:42:38 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id 23so16458596lfg.10 for ; Thu, 07 Jan 2021 09:42:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LRqxwEPJISEBHpjqZE2l6FmdiTZQs0jM9TpD8cQN+YA=; b=V0YYF8gWI5uIyBICJ6udbyu5HQC3NPDSYKcM0W27RFdEEv//zmAWylWYvEw3vVGTLk 7shGRVqcO5n0D/CR7V6LG8naB6ZmufIvZoX0HqL5BSNYe7lr1TVddGvzs3mMPz0MCPKo +zVPhNZ4dqAaZf48kkvaUOFLNxKSL/LGiN9TI= 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=LRqxwEPJISEBHpjqZE2l6FmdiTZQs0jM9TpD8cQN+YA=; b=SAIjYc31TB9kjZ1GDHX5V9MpIszww4+Zuh7TfyDS3iDuezRKRFqvotYvJRROCxJknz 75C82P7G+5tH03Pz8GKI/Kv90oi/DOVS2SPlGjC+mZGcwwb9mjeM7K3YdLLcPj/y/qum pi3ZZV/zVDi9/j7qDzdBYI2roFHz+f7yRyME16GdxgoIGVN1oGzlV40sSvFk8hhXP37i b+3O7nZsiaBbOC1d4IpEX1ORUpUZ9LbTwM6NtwZjFDCzhbRVFXxmRQo1izAn12zpecGJ oYOOuRbZk5nyc9w1jKzqllCowR07VTqYNAw2vI3tyoV05xpHDU1dZ5kc2/8MMlq3bn51 8jQQ== X-Gm-Message-State: AOAM532aaEZF9eYZghAM3WYstiruLQPVTaCZ4QqSx1yaisCi8Z5YoNgd zxQe52U7FaNAj69SPPeIAX4519a90anpFs/NpT69/A== X-Received: by 2002:a2e:361a:: with SMTP id d26mr4804735lja.115.1610041356957; Thu, 07 Jan 2021 09:42:36 -0800 (PST) MIME-Version: 1.0 References: <20210104235719.13525-1-ivan@cloudflare.com> <2100533.HVZEckHxcR@c100> In-Reply-To: <2100533.HVZEckHxcR@c100> From: Ivan Babrou Date: Thu, 7 Jan 2021 09:42:25 -0800 Message-ID: Subject: Re: [PATCH] cpupower: add Makefile dependencies for install targets To: Thomas Renninger Cc: linux-pm@vger.kernel.org, linux-kernel , kernel-team , Shuah Khan Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 7, 2021 at 2:07 AM Thomas Renninger wrote: > > Am Dienstag, 5. Januar 2021, 00:57:18 CET schrieb Ivan Babrou: > > This allows building cpupower in parallel rather than serially. > > cpupower is built serially: > > [ make clean ] > > time make > real 0m3,742s > user 0m3,330s > sys 0m1,105s > > [ make clean ] > > time make -j10 > real 0m1,045s > user 0m3,153s > sys 0m1,037s > > Only advantage I see is that you can call > make install-xy > targets without calling the corresponding build target > make xy > similar to the general install target: > install: all install-lib ... > > Not sure anyone needs this and whether all targets > successfully work this way. > If you'd show a useful usecase example... We build a bunch of kernel related tools (perf, cpupower, bpftool, etc.) from our own top level Makefile, propagating parallelism downwards like one should. Without this patch we have to remove parallelism for cpupower, which doesn't seem like a very clean thing to do, especially if you consider that it's 3x faster with parallelism enabled in wall clock terms. > Thomas > > > > > Signed-off-by: Ivan Babrou > > --- > > tools/power/cpupower/Makefile | 8 ++++---- > > tools/power/cpupower/bench/Makefile | 2 +- > > 2 files changed, 5 insertions(+), 5 deletions(-) > > > > diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile > > index c7bcddbd486d..3b1594447f29 100644 > > --- a/tools/power/cpupower/Makefile > > +++ b/tools/power/cpupower/Makefile > > @@ -270,14 +270,14 @@ clean: > > $(MAKE) -C bench O=$(OUTPUT) clean > > > > > > -install-lib: > > +install-lib: libcpupower > > $(INSTALL) -d $(DESTDIR)${libdir} > > $(CP) $(OUTPUT)libcpupower.so* $(DESTDIR)${libdir}/ > > $(INSTALL) -d $(DESTDIR)${includedir} > > $(INSTALL_DATA) lib/cpufreq.h $(DESTDIR)${includedir}/cpufreq.h > > $(INSTALL_DATA) lib/cpuidle.h $(DESTDIR)${includedir}/cpuidle.h > > > > -install-tools: > > +install-tools: $(OUTPUT)cpupower > > $(INSTALL) -d $(DESTDIR)${bindir} > > $(INSTALL_PROGRAM) $(OUTPUT)cpupower $(DESTDIR)${bindir} > > $(INSTALL) -d $(DESTDIR)${bash_completion_dir} > > @@ -293,14 +293,14 @@ install-man: > > $(INSTALL_DATA) -D man/cpupower-info.1 > > $(DESTDIR)${mandir}/man1/cpupower-info.1 $(INSTALL_DATA) -D > > man/cpupower-monitor.1 $(DESTDIR)${mandir}/man1/cpupower-monitor.1 > > > > -install-gmo: > > +install-gmo: create-gmo > > $(INSTALL) -d $(DESTDIR)${localedir} > > for HLANG in $(LANGUAGES); do \ > > echo '$(INSTALL_DATA) -D $(OUTPUT)po/$$HLANG.gmo > > $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo'; \ $(INSTALL_DATA) > > -D $(OUTPUT)po/$$HLANG.gmo > > $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo; \ done; > > > > -install-bench: > > +install-bench: compile-bench > > @#DESTDIR must be set from outside to survive > > @sbindir=$(sbindir) bindir=$(bindir) docdir=$(docdir) confdir=$ > (confdir) > > $(MAKE) -C bench O=$(OUTPUT) install > > > > diff --git a/tools/power/cpupower/bench/Makefile > > b/tools/power/cpupower/bench/Makefile index f68b4bc55273..d9d9923af85c > > 100644 > > --- a/tools/power/cpupower/bench/Makefile > > +++ b/tools/power/cpupower/bench/Makefile > > @@ -27,7 +27,7 @@ $(OUTPUT)cpufreq-bench: $(OBJS) > > > > all: $(OUTPUT)cpufreq-bench > > > > -install: > > +install: $(OUTPUT)cpufreq-bench > > mkdir -p $(DESTDIR)/$(sbindir) > > mkdir -p $(DESTDIR)/$(bindir) > > mkdir -p $(DESTDIR)/$(docdir) > > > >