• L
    perf c2c: Use stdio interface if slang is not supported · 732db167
    Leo Yan 提交于
    stable inclusion
    from stable-v5.10.121
    commit c8c2802407aa62ca0177802b0978edc689dabf3e
    category: bugfix
    bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6CQ
    
    Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c8c2802407aa62ca0177802b0978edc689dabf3e
    
    --------------------------------
    
    [ Upstream commit c4040212 ]
    
    If the slang lib is not installed on the system, perf c2c tool disables TUI
    mode and roll back to use stdio mode;  but the flag 'c2c.use_stdio' is
    missed to set true and thus it wrongly applies UI quirks in the function
    ui_quirks().
    
    This commit forces to use stdio interface if slang is not supported, and
    it can avoid to apply the UI quirks and show the correct metric header.
    
    Before:
    Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
    
    =================================================
          Shared Cache Line Distribution Pareto
    =================================================
      -------------------------------------------------------------------------------
          0        0        0       99        0        0        0      0xaaaac17d6000
      -------------------------------------------------------------------------------
        0.00%    0.00%    6.06%    0.00%    0.00%    0.00%   0x20   N/A       0      0xaaaac17c25ac         0         0        43       375    18469         2  [.] 0x00000000000025ac  memstress         memstress[25ac]   0
        0.00%    0.00%   93.94%    0.00%    0.00%    0.00%   0x29   N/A       0      0xaaaac17c3e88         0         0       173       180      135         2  [.] 0x0000000000003e88  memstress         memstress[3e88]   0
    
    After:
    
    =================================================
          Shared Cache Line Distribution Pareto
    =================================================
      -------------------------------------------------------------------------------
          0        0        0       99        0        0        0      0xaaaac17d6000
      -------------------------------------------------------------------------------
               0.00%    0.00%    6.06%    0.00%    0.00%    0.00%                0x20   N/A       0      0xaaaac17c25ac         0         0        43       375    18469         2  [.] 0x00000000000025ac  memstress         memstress[25ac]   0
               0.00%    0.00%   93.94%    0.00%    0.00%    0.00%                0x29   N/A       0      0xaaaac17c3e88         0         0       173       180      135         2  [.] 0x0000000000003e88  memstress         memstress[3e88]   0
    
    Fixes: 5a1a99cd ("perf c2c report: Add main TUI browser")
    Reported-by: NJoe Mario <jmario@redhat.com>
    Signed-off-by: NLeo Yan <leo.yan@linaro.org>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Link: http://lore.kernel.org/lkml/20220526145400.611249-1-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: NSasha Levin <sashal@kernel.org>
    Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
    732db167
builtin-c2c.c 80.7 KB