[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi] Can linux-perf illuminate this problem?
From: |
Greg Chicares |
Subject: |
[lmi] Can linux-perf illuminate this problem? |
Date: |
Fri, 5 Mar 2021 20:30:53 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 |
Vadim--I seem to have done something awful in a commit that I've
pushed only to this branch, but not to origin/master:
https://git.savannah.nongnu.org/cgit/lmi.git/commit/?h=odd/eraseme
| commit d1ae1eaeef2ed1a1ddd15b47f19703d6a26b1e5d
| Use currency type for max non-MEC payment
| This commit has a disastrous effect on performance as measured by
| 'make cli_timing': for the first ('naic, no solve') scenario, the
| penalty is 14% for i686 and 30% for x86_64. How can that be?
I pushed that branch to origin so that I could easily switch to it
in a chroot that's configured to use linux-perf. I can get 'perf'
to tell me what I already know--that AccountValue::DoMonthDR() is
where the problem is--but can it tell me which statements are
responsible?
I used this command:
$LD_LIBRARY_PATH=.:/opt/lmi/bin:/opt/lmi/local/gcc_x86_64-pc-linux-gnu/lib/:/srv/cache_for_lmi/perf_ln
/srv/cache_for_lmi/perf_ln/perf_4.19 record --freq=max --call-graph=lbr
/opt/lmi/bin/lmi_cli_shared --accept --data_path=/opt/lmi/data --selftest
to collect data: first, with the offending commit; then, again,
without the offending commit.
This command:
$LD_LIBRARY_PATH=.:/srv/cache_for_lmi/perf_ln
/srv/cache_for_lmi/perf_ln/perf_4.19 diff
tells me:
# Baseline Delta Abs Shared Object Symbol
>
# ........ ......... ....................
.....................................................>
#
14.90% -10.35% liblmi.so [.] AccountValue::DoMonthDR
but doesn't let me drill down.
This command:
$LD_LIBRARY_PATH=.:/srv/cache_for_lmi/perf_ln
/srv/cache_for_lmi/perf_ln/perf_4.19 report -i /opt/lmi/src/lmi/perf.data.old
and a similar one without '.old' at the end show me a detailed
profile with (perf.data.old) and without (perf.data) the offending
commit. Truncating right after the AccountValue::DoMonthDR() line:
Samples: 77K of event 'cycles:ppp', Event count (approx.): 18328223965
Children Self Command Shared Object Symbol
+ 84.36% 0.00% lmi_cli_shared liblmi.so [.] IllusVal::run
+ 75.26% 0.22% lmi_cli_shared liblmi.so [.]
AccountValue::RunOneCell
+ 70.84% 0.00% lmi_cli_shared liblmi.so [.]
AccountValue::Solve
+ 70.83% 0.02% lmi_cli_shared liblmi.so [.]
decimal_root<SolveHelper>
+ 70.40% 0.06% lmi_cli_shared liblmi.so [.]
AccountValue::SolveTest
+ 62.39% 0.37% lmi_cli_shared liblmi.so [.]
AccountValue::IncrementBOM
+ 59.99% 14.90% lmi_cli_shared liblmi.so [.]
AccountValue::DoMonthDR
+ 82.77% 0.00% lmi_cli_shared liblmi.so [.] IllusVal::run
+ 72.69% 0.20% lmi_cli_shared liblmi.so [.]
AccountValue::RunOneCell
+ 70.13% 0.00% lmi_cli_shared liblmi.so [.]
AccountValue::Solve
+ 70.12% 0.02% lmi_cli_shared liblmi.so [.]
decimal_root<SolveHelper>
+ 69.59% 0.07% lmi_cli_shared liblmi.so [.]
AccountValue::SolveTest
+ 58.00% 0.44% lmi_cli_shared liblmi.so [.]
AccountValue::IncrementBOM
+ 55.08% 4.55% lmi_cli_shared liblmi.so [.]
AccountValue::DoMonthDR
shows that the 14.90% vs 4.55% performance regression is in that
function. I can drill down into both...
- 59.99% 14.90% lmi_cli_shared liblmi.so [.]
AccountValue::DoMonthDR
- 45.09% AccountValue::DoMonthDR
14.10% AccountValue::TxSpecAmtChange@plt
+ 4.36% AccountValue::TxSetDeathBft
+ 3.84% AccountValue::InitializeMonth
+ 3.10% Irc7702A::MaxNonMecPremium
+ 2.70% Irc7702A::MaxNecessaryPremium
1.81% AccountValue::TxSetCoiCharge@plt
+ 1.42% AccountValue::TxSetBOMAV
- 50.53% AccountValue::DoMonthDR
16.73% AccountValue::TxSpecAmtChange@plt
+ 5.12% AccountValue::TxSetDeathBft
+ 4.29% AccountValue::InitializeMonth
+ 3.30% Irc7702A::MaxNonMecPremium
+ 2.79% Irc7702A::MaxNecessaryPremium
2.11% AccountValue::TxSetCoiCharge@plt
+ 1.73% AccountValue::TxSetBOMAV
...but that only seems to tell me how much time is spent in each
function called by AccountValue::DoMonthDR(). However, I suspect
that I've done something atrocious inside DoMonthDR() itself.
Can 'perf' help me find that?
- [lmi] Can linux-perf illuminate this problem?,
Greg Chicares <=