Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable specifying stacktrace size at runtime. #470

Merged
merged 2 commits into from
Oct 26, 2018

Conversation

trivialfis
Copy link
Member

@hcho3
This PR also groups GTest CMake configuration together. Seems to have some conflicts with previous commits. Let me see if it breaks the tests.
The change is mostly for dmlc/xgboost#3795 . With this I don't need the PROFILING option.

@trivialfis trivialfis force-pushed the stacktrace branch 3 times, most recently from 248d038 to fcf38a3 Compare October 16, 2018 12:08
@trivialfis trivialfis changed the title Enable specifying stacktrace size at runtime. [WIP] Enable specifying stacktrace size at runtime. Oct 16, 2018
@trivialfis
Copy link
Member Author

Still trying to figure out the best way to profile the memory usage. :) Sorry for these early PRs.

@hcho3
Copy link
Contributor

hcho3 commented Oct 16, 2018

@trivialfis Don't be sorry. Your contribution to dmlc-core is quite valuable.

* Add extra optional parameter to StackTrace.
* Enable finding GTest installed in system
* Make build_config.h for unittests private.
@trivialfis trivialfis changed the title [WIP] Enable specifying stacktrace size at runtime. Enable specifying stacktrace size at runtime. Oct 25, 2018
@hcho3
Copy link
Contributor

hcho3 commented Oct 25, 2018

@trivialfis Is this PR ready for review?

@trivialfis
Copy link
Member Author

@hcho3 Yes. Along with dmlc/xgboost#3795 . The only problem is we are hesitating to merge it due to:

  • We don't know whether nvprof will support this in near future.
  • I'm kind of the only one who's running it.

Merging dmlc/xgboost#3795 will be another large chunk of code, we are not sure it's worthy. You can take a look into it if you have the time.
If we decide not to merge profiling, I will extract other changes in this PR and create a new one.

@hcho3
Copy link
Contributor

hcho3 commented Oct 25, 2018

@trivialfis Looking at this PR in isolation, I think the ability to specify stacktrace size at runtime would be useful to other people as well. Let us evaluate the merits of dmlc/xgboost#3795 at later time, after we merge this change.

@trivialfis
Copy link
Member Author

@hcho3 Thanks. It's ready for review.

include/dmlc/logging.h Outdated Show resolved Hide resolved
test/unittest/CMakeLists.txt Outdated Show resolved Hide resolved
include/dmlc/logging.h Outdated Show resolved Hide resolved
* Make StackTrace size unsigned.
* Don't output build_config.h into binary directory.
Copy link
Contributor

@hcho3 hcho3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hcho3
Copy link
Contributor

hcho3 commented Oct 26, 2018

@trivialfis On a related note, let's add an option to XGBoost to enable "rich" backtraces: https://github.com/bombela/backward-cpp. Right now it only supports UNIX-like systems, but we can add it as an optional feature in the developer guide (think sanitizers).

@trivialfis
Copy link
Member Author

@hcho3 Seems interesting. From my experience, I can barely get the backtrace working in dmlc-core and failed to make a reliable test for it. I will take a look into that at the weekend.

@hcho3 hcho3 merged commit 32440d6 into dmlc:master Oct 26, 2018
@trivialfis trivialfis deleted the stacktrace branch October 26, 2018 05:29
@trivialfis
Copy link
Member Author

@hcho3 I looked into the source code of backward-cpp. It supports a wide ranges of "backend" libraries. It's already very messy to achieve what it does, if we were to add this into dmlc-core, I think we better limit the support to libdw only.

For build option, we can utilize CMake's CMAKE_CXX_FLAGS_DEBUG variable.

But let me focus on dmlc/xgboost#3825 first, I'm a little bit tied up to that currently. I will come back to this.

@hcho3
Copy link
Contributor

hcho3 commented Oct 27, 2018

@trivialfis I don't think we should add backward-cpp to dmlc-core, since it is quite messy. It should be added to xgboost directly.

@hcho3
Copy link
Contributor

hcho3 commented Oct 27, 2018

@trivialfis Actually, I take back what I said, since all errors get directed to LOG(FATAL), which is part of dmlc-core.

Anyway, let's hold it for now, since we have other things to worry about. Also, I think we want to "modernize" the CMake build before we attempt to do something fancy like backward-cpp. See discussion at #460 about Modern CMake practices.

ruslo pushed a commit to hunter-packages/dmlc-core that referenced this pull request Mar 23, 2019
* Enable specifying trace size at runtime.

* Add extra optional parameter to StackTrace.
* Enable finding GTest installed in system
* Make build_config.h for unittests private.

* Address reviewer's comment.

* Make StackTrace size unsigned.
* Don't output build_config.h into binary directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants