This is an archive of the discontinued LLVM Phabricator instance.

[LNT] Added reading nm and objdump paths from env variables
ClosedPublic

Authored by kpdev42 on Sep 30 2021, 8:07 AM.

Details

Summary
  • Added reading nm and objdump paths from env variables
  • Added binaryCacheRoot

Diff Detail

Event Timeline

kpdev42 created this revision.Sep 30 2021, 8:07 AM
kpdev42 requested review of this revision.Sep 30 2021, 8:07 AM

Could you split this patch up a bit?

kpdev42 updated this revision to Diff 376439.Oct 1 2021, 1:00 AM
kpdev42 edited the summary of this revision. (Show Details)

Removed Windows support (will be done in a separate patch)

Could you split this patch up a bit?

Yes, please review: windows support were removed (will be done as a separate patch)

@thopre Should I rework this patch somehow?

thopre added a comment.Oct 5 2021, 7:31 AM

@thopre Should I rework this patch somehow?

I think ideally the bullet points in your patch description should each correspond to a different patch. That said, I don't have sufficient expertise to review everything but I might be able to review some of the resulting patches.

lnt/testing/profile/profile.py
34–36

This will set the parameters to None (and thus override the default values of the parameter) when the environment variables are not set. I don't think this is what you meant.

slydiman added inline comments.
lnt/testing/profile/profile.py
34–36
import os

def prn(x):
    print(x)

prn(x = os.getenv('MISSING_VAR', 'abc'))

Output: abc
What am I missing?

thopre added inline comments.Oct 6 2021, 3:50 AM
lnt/testing/profile/profile.py
34–36

Nothing, I missed something: the second parameter of getenv.

kpdev42 marked 2 inline comments as done.Oct 6 2021, 6:03 AM
yakush added a subscriber: yakush.Oct 7 2021, 2:31 AM
yakush added inline comments.Oct 7 2021, 2:36 AM
lnt/testing/profile/profile.py
34–36

this patch was actually tested in production setup, so it works at least on some platforms.

kpdev42 updated this revision to Diff 377814.Oct 7 2021, 5:48 AM
kpdev42 retitled this revision from [LNT] Refactoring of cPerf to [LNT] Added reading nm and objdump paths from env variables.
kpdev42 edited the summary of this revision. (Show Details)

I've divided previously uploaded patch and minimized all changes. Main new functional of cPerf usage refactoring will follow in a next patch

@thopre Kindly ask you to review this version of patch

Please review this patch

Please add some tests for the environment variables and possibly for the bug fixes depending on what they are. This should also be split into 4 patches, one for each items mentioned. They are all independent, even if you likely made them in one go to get Linux perf work for you. One important reason for splitting is if an issue is found with one of the items the whole patch might need to be reverted. It also allow for easier cherry-pick for people who maintain their own branch of LNT.

Besides the missing tests, the patch LGTM and I'll be happy to approve it.

Please add some tests for the environment variables and possibly for the bug fixes depending on what they are. This should also be split into 4 patches, one for each items mentioned. They are all independent, even if you likely made them in one go to get Linux perf work for you. One important reason for splitting is if an issue is found with one of the items the whole patch might need to be reverted. It also allow for easier cherry-pick for people who maintain their own branch of LNT.

Besides the missing tests, the patch LGTM and I'll be happy to approve it.

Most changes in cPerf.cpp are related to the standalone mode which is not used in the production. This mode is designed only for debug purpose. It cannot break anything.

cPerf.cpp was already designed to get nm and objdump path as the parameter (with default value).

The environment variables are used to

  • redefine or specify the full path to the tools nm and objdump;
  • set the root path to binaries.

What are the options? I see only 2 options - the variable is missing (current default behavior) or the variable contains a path to the tool which is used as is. What may be wrong in the code nm = os.getenv('CMAKE_NM', 'nm')?
I don't see any purpose of such tests.

It is necessary to add some executable binaries (tools) and probably some profile files to the LNT repository for requested tests. I think it is redundant and very bad idea. It is impossible to design such tests to be valid on any target or at least on most targets.

I suggest to accept this patch and commit it as is.

BTW, I see that LNT tests did not execute automatically. Something is totally broken here around LNT tests and all LNT tests are useless for now. Who should we ping to fix this?

Please add some tests for the environment variables and possibly for the bug fixes depending on what they are. This should also be split into 4 patches, one for each items mentioned. They are all independent, even if you likely made them in one go to get Linux perf work for you. One important reason for splitting is if an issue is found with one of the items the whole patch might need to be reverted. It also allow for easier cherry-pick for people who maintain their own branch of LNT.

Besides the missing tests, the patch LGTM and I'll be happy to approve it.

Most changes in cPerf.cpp are related to the standalone mode which is not used in the production. This mode is designed only for debug purpose. It cannot break anything.

Still, the title does not reflect what is happening in the diff which is a clear sign the patch should be split and this is a completely independent change. If the fixes are also for standalone mode I'm happy for the patch to be split in 2 only: standalone+fixes and envvars+bincacheroot.

BTW, I see that LNT tests did not execute automatically. Something is totally broken here around LNT tests and all LNT tests are useless for now. Who should we ping to fix this?

Whoever broke the tests. There's at least 3 failures:

  • plistlib change I introduced seems to only work for Python3, I'll make a patch
  • future needs to be installed for mypy to work (I'm guessing some recent Python version don't have it in the standard library anymore because it used to work) I've created https://reviews.llvm.org/D112148
  • Something in runtest/test_suite.shtest

I think py27 fails because of plistlib change I introduced which only works for Python 3. I need to revisit that. Python3 fails for me because I think I'm using a too new version which seems to have dropped future.

  • plistlib change I introduced seems to only work for Python3, I'll make a patch

https://reviews.llvm.org/D112185

  • Something in runtest/test_suite.shtest

https://reviews.llvm.org/D112182

kpdev42 updated this revision to Diff 381155.Oct 21 2021, 12:05 AM
kpdev42 edited the summary of this revision. (Show Details)

Simplify diff

thopre accepted this revision.Oct 21 2021, 12:21 AM

LGTM, thanks!

This revision is now accepted and ready to land.Oct 21 2021, 12:21 AM