[SERVER-13360] MongoDB will not build w/ CPU profiler enabled Created: 08/Oct/12  Updated: 19/Sep/15  Resolved: 11/May/15

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: 2.2.0
Fix Version/s: 3.1.3

Type: Bug Priority: Major - P3
Reporter: Mongo Phan Assignee: Jonathan Reams
Resolution: Done Votes: 0
Labels: build-jbr
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux / Debian
Linux myhost 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64 GNU/Linux


Attachments: File patch    
Issue Links:
Related
related to SERVER-14581 mongod doesn't compile with cpu-profi... Closed
Backwards Compatibility: Fully Compatible
Operating System: Linux
Sprint: BUILD 3 05/15/15
Participants:

 Description   

Use of the --cpu-profiler option will not build; gets a link error.
This is mongodb 2.2.0
I had to patch the SConscript file in src/mongo
That patch is attached.

Once built, I find the output from Google perftools pretty useless, e.g. most of the time is spontaneous calls to "memcpy" on a simple bulk-insert intensive script. Is anyone at all using the CPU profiler feature? Looks like not.



 Comments   
Comment by Githook User [ 11/May/15 ]

Author:

{u'username': u'jbreams', u'name': u'Jonathan Reams', u'email': u'jbreams@mongodb.com'}

Message: SERVER-13360 Check for libunwind if cpu-profiler is turned on
Branch: master
https://github.com/mongodb/mongo/commit/7c7025f96138ec946dd06e869f59a3af56ed63b8

Comment by Ernie Hershey [ 24/Jul/14 ]

This command line gives one error:
/usr/local/bin/scons --use-cpu-profiler all dist

In file included from src/third_party/gperftools-2.2/src/stacktrace.cc:96:
In file included from src/third_party/gperftools-2.2/src/stacktrace_impl_setup-inl.h:51:
src/third_party/gperftools-2.2/src/stacktrace_libunwind-inl.h:59:8: error: thread-local storage is unsupported for the current target
static __thread int recursive;
       ^
1 error generated.
scons: *** [build/darwin/normal/third_party/gperftools-2.2/src/stacktrace.o] Error 1

And this command line gives this error:
/usr/local/bin/scons --use-cpu-profiler --allocator=system -j1 --release --osx-version-min=10.6 all dist

ld: library not found for -lunwind
clang: error: linker command failed with exit code 1 (use -v to see invocation)
scons: *** [build/darwin/allocator_system/release/mongo/mongo] Error 1
scons: building terminated because of errors.

Comment by Ernie Hershey [ 09/Jul/14 ]

I get errors in osx -

Generating build/darwin/allocator_system/release/buildinfo.cpp
src/mongo/db/commands/cpuprofile.cpp:138:27: error: no matching constructor for initialization of 'Lock::DBWrite'
            Lock::DBWrite dbXLock(db);
                          ^       ~~
src/mongo/db/d_concurrency.h:162:15: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from
      'const std::string' (aka 'const basic_string<char>') to 'const mongo::Lock::DBWrite' for 1st argument
        class DBWrite : public ScopedLock {
              ^
src/mongo/db/d_concurrency.h:183:13: note: candidate constructor not viable: requires at least 2 arguments, but 1 was provided
            DBWrite(LockState* lockState, const StringData& dbOrNs, bool intentWrite = false);
            ^
src/mongo/db/commands/cpuprofile.cpp:157:27: error: no matching constructor for initialization of 'Lock::DBWrite'
            Lock::DBWrite dbXLock(db);
                          ^       ~~
src/mongo/db/d_concurrency.h:162:15: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from
      'const std::string' (aka 'const basic_string<char>') to 'const mongo::Lock::DBWrite' for 1st argument
        class DBWrite : public ScopedLock {
              ^
src/mongo/db/d_concurrency.h:183:13: note: candidate constructor not viable: requires at least 2 arguments, but 1 was provided
            DBWrite(LockState* lockState, const StringData& dbOrNs, bool intentWrite = false);
            ^
2 errors generated.
scons: *** [build/darwin/allocator_system/release/mongo/db/commands/cpuprofile.o] Error 1
scons: building terminated because of errors.

Comment by Ramon Fernandez Marina [ 06/Jun/14 ]

Hi mongophan, we haven't heard from you in a while. Are you still interested in pursuing this issue? Please let us know.

Regards,
Ramón.

Comment by Ernie Hershey [ 28/Apr/14 ]

hi mongophan, thanks for submitting this patch. It no longer cleanly applies in master though. Can you try with a more recent version of our source code and include the error you're seeing along with a new patch if you choose to update it? Also for us to consider a contribution you'll have to sign our contributors agreement here - http://www.mongodb.com/legal/contributor-agreement

Comment by Randall Hunt [ 26/Oct/12 ]

schwerin this patch LGTM should we merge it?

Generated at Thu Feb 08 03:31:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.