Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752030AbcCJOE6 (ORCPT ); Thu, 10 Mar 2016 09:04:58 -0500 Received: from mail-pa0-f48.google.com ([209.85.220.48]:35296 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752003AbcCJOEn (ORCPT ); Thu, 10 Mar 2016 09:04:43 -0500 From: Taeung Song To: Arnaldo Carvalho de Melo Cc: linux-kernel@vger.kernel.org, Jiri Olsa , Namhyung Kim , Ingo Molnar , Peter Zijlstra , Taeung Song Subject: [TEST REPORT][PATCH] perf config: Introduce perf_config_set class Date: Thu, 10 Mar 2016 23:04:37 +0900 Message-Id: <1457618677-19962-1-git-send-email-treeze.taeung@gmail.com> X-Mailer: git-send-email 2.5.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2993 Lines: 113 Tested-by: Taeung Song Test-Date: 2016-03-10 Version: perf version 4.5.rc2.g8c497f Kernel: 4.5.0-rc4+ Distro: Ubuntu 15.10 wily Test Environment: 1. Perf PATH # whereis perf perf: /usr/local/bin/perf /usr/local/share/man/man1/perf.1.gz 2. User config file # cat ~/.perfconfig [report] queue-size = 1 [call-graph] threshold = 2.0 [test] location = user [top] children = false 3. System config file # cat /usr/local/etc/perfconfig [ui] show-headers = false [test] location = system [top] children = true Test Results: Case 0) BASIC: perf_config() function work normally # cat ~/.perfconfig [colors] top = blue, white # perf top (omitted output, there isn't any problem) Case 1) BASIC: List functionality without a specific file (equal with user + system config, but user config has order of priority) # cat ~/.perfconfig [report] queue-size = 1 [call-graph] threshold = 2.0 [test] location = user [top] children = false # perf config --list ui.show-headers=false call-graph.threshold=2.0 report.queue-size=1 top.children=false test.location=user Case 2) BASIC: List functionality with user config file # perf config --user --list call-graph.threshold=2.0 report.queue-size=1 top.children=false test.location=user Case 3) BASIC: List functionality with system config file # perf config --system --list ui.show-headers=false top.children=true test.location=system Case 4) EXCEP HANDLING: If using two config file at a time # perf config --user --system --list Error: only one config file at a time Usage: perf config [] [options] --user use user config file- --system use system config file Case 5) EXCEP HANDLING: user config file : don't exist || permission denied || empty (user wide ~/.perfconfig) # perf config --user --list Nothing configured, please check your /home/taeung/.perfconfig Case 6) EXCEP HANDLING: system config file : don't exist || permission denied || empty (system wide /usr/local/etc/perfconfig depending on perf PATH) # perf config --system --list Nothing configured, please check your /usr/local/etc/perfconfig Cc: Namhyung Kim Cc: Jiri Olsa --- tools/perf/builtin-config.c | 61 +++++++--- tools/perf/util/cache.h | 2 - tools/perf/util/config.c | 268 +++++++++++++++++++++++++++++++++++++++++--- tools/perf/util/config.h | 138 +++++++++++++++++++++++ 4 files changed, 433 insertions(+), 36 deletions(-) create mode 100644 tools/perf/util/config.h