GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove gtest during build by r1viollet · Pull Request #251 · DataDog/java-profiler

Conversation

@r1viollet

@r1viollet r1viollet commented Jul 24, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

What does this PR do?:

Remove gtest during build
Clarify outputs for async-profiler check

Motivation:

Consecutive builds are faster

Additional Notes:

NA

How to test the change?:

We already call test commands which will run gtests

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.
  • JIRA: [JIRA-XXXX]

Unsure? Have a question? Request a review!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@r1viollet
Remove gtest during build
7918ebb
Clarify outputs for async-profiler checkout
@r1viollet
r1viollet requested a review from jbachorik July 24, 2025 13:00
@github-actions

github-actions Bot commented Jul 24, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

🔧 Report generated by pr-comment-scanbuild

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@r1viollet
r1viollet force-pushed the r1viollet/remove_gtest_during_build branch from 020f9cc to 964e71f Compare July 24, 2025 13:01
@github-actions

github-actions Bot commented Jul 24, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

🔧 Report generated by pr-comment-cppcheck

CppCheck Report

Errors (2)

  • There is an unknown macro here somewhere. Configuration is required. If LP64_ONLY is a macro then please configure it.
  • syntax error

Warnings (8)

  • The class 'RecordingBuffer' defines member function with name 'flushIfNeeded' also defined in its parent class 'Buffer'.
  • Member variable 'CodeCache::_image_base' is not initialized in the copy constructor.
  • Member variable 'CodeCache::_image_base' is not assigned a value in 'CodeCache::operator='.
  • Member variable 'JitWriteProtection::_restore' is not initialized in the constructor.
  • Member variable 'JitWriteProtection::_restore' is not initialized in the constructor.
  • Either the condition 'uc!=nullptr' is redundant or there is possible null pointer dereference: uc.
  • Obsolete function 'alloca' called.
  • Member variable 'ElfParser::_vaddr_diff' is not initialized in the constructor.

Style Violations (300)

  • Class 'Arguments' has a constructor with 1 argument that is not explicit.
  • struct member 'Multiplier::symbol' is never used.
  • struct member 'Multiplier::multiplier' is never used.
  • class member 'Error::OK' is never used.
  • Class 'AsyncSampleMutex' has a constructor with 1 argument that is not explicit.
  • The class 'NativeFunc' does not declare a constructor although it has private member variables which likely require initialization.
  • Local variable 'count' shadows outer function
  • Local variable 'blob' shadows outer function
  • Local variable 'i' shadows outer variable
  • Parameter 'prefixes' can be declared as reference to const
  • Variable 'cb1' can be declared as pointer to const
  • Variable 'cb2' can be declared as pointer to const
  • Variable 'fd1' can be declared as pointer to const
  • Variable 'fd2' can be declared as pointer to const
  • Parameter 'name' can be declared as pointer to const
  • Consider using std::transform algorithm instead of a raw loop.
  • struct member 'ContextPage::capacity' is never used.
  • struct member 'ContextPage::storage' is never used.
  • class member 'Contexts::_max_pages' is never used.
  • class member 'Contexts::_pages' is never used.
  • The function 'check' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'start' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'registerThread' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'unregisterThread' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'name' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'interval' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'check' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'start' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'stop' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'enableEvents' overrides a function in a base class but is not marked with a 'override' specifier.
  • class member 'CTimer::_cstack' is never used.
  • class member 'CTimer::_signal' is never used.
  • class member 'CTimer::_max_timers' is never used.
  • class member 'CTimer::_timers' is never used.
  • class member 'Shims::_tid_setter_ref' is never used.
  • Class 'Dictionary' has a constructor with 1 argument that is not explicit.
  • struct member 'DictRow::keys' is never used.
  • struct member 'DictRow::next' is never used.
  • Operator '|' with one operand equal to zero is redundant.
  • Operator '|' with one operand equal to zero is redundant.
  • Operator '|' with one operand equal to zero is redundant.
  • Local variable 'table' shadows outer function
  • Local variable 'pc_off' shadows outer variable
  • Variable 'table' can be declared as pointer to const
  • struct member 'FrameDesc::fp_off' is never used.
  • struct member 'FrameDesc::pc_off' is never used.
  • class member 'DwarfParser::_name' is never used.
  • class member 'DwarfParser::_image_base' is never used.
  • class member 'DwarfParser::_capacity' is never used.
  • class member 'DwarfParser::_prev' is never used.
  • class member 'DwarfParser::_data_align' is never used.
  • Class 'WallClockEpochEvent' has a constructor with 1 argument that is not explicit.
  • class member 'LockEvent::_address' is never used.
  • class member 'LockEvent::_timeout' is never used.
  • The function 'name' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'interval' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'check' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'start' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'stop' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'enableEvents' overrides a function in a base class but is not marked with a 'override' specifier.
  • class member 'ITimer::_cstack' is never used.
  • The class 'J9WallClock' does not declare a constructor although it has private member variables which likely require initialization.
  • The function 'name' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'interval' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'start' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'stop' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'enableEvents' overrides a function in a base class but is not marked with a 'override' specifier.
  • class member 'J9WallClock::_max_stack_depth' is never used.
  • class member 'J9WallClock::_running' is never used.
  • Class 'Element' has a constructor with 1 argument that is not explicit.
  • Class 'NoField' has a constructor with 1 argument that is not explicit.
  • The function 'is_nofield' overrides a function in a base class but is not marked with a 'override' specifier.
  • class member 'JfrMetadata::_initialized' is never used.
  • class member 'JVM::_is_readable_pointer_resolved' is never used.
  • class member 'JVM::_is_readable_pointer' is never used.
  • The class 'VirtualSpaceSummary' does not declare a constructor although it has private member variables which likely require initialization.
  • The class 'GCHeapSummary' does not declare a constructor although it has private member variables which likely require initialization.
  • The class 'CollectedHeapWrapper' does not declare a constructor although it has private member variables which likely require initialization.
  • class member 'VirtualSpaceSummary::_committed_end' is never used.
  • class member 'GCHeapSummary::vptr' is never used.
  • class member 'CollectedHeapWrapper::vptr' is never used.
  • class member 'CollectedHeapWrapper::_gc_heap_log' is never used.
  • class member 'CollectedHeapWrapper::_capacity_at_last_gc' is never used.
  • class member 'CollectedHeapWrapper::_used_at_last_gc' is never used.
  • struct member 'Chunk::prev' is never used.
  • struct member 'Chunk::offs' is never used.
  • struct member 'Chunk::_padding' is never used.
  • class member 'LinearAllocator::_chunk_size' is never used.
  • class member 'LinearAllocator::_tail' is never used.
  • class member 'LinearAllocator::_reserve' is never used.
  • Class 'SpinLock' has a constructor with 1 argument that is not explicit.
  • struct member 'TrackingEntry::skipped' is never used.
  • class member 'LivenessTracker::MAX_TRACKING_TABLE_SIZE' is never used.
  • class member 'LivenessTracker::MIN_SAMPLING_INTERVAL' is never used.
  • class member 'LivenessTracker::_table_lock' is never used.
  • class member 'Log::_file' is never used.
  • class member 'Log::LEVEL_NAME' is never used.
  • The function 'check' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'start' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'stop' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'interval' overrides a function in a base class but is not marked with a 'override' specifier.
  • class member 'ObjectSampler::CONFIG_UPDATE_CHECK_PERIOD_SECS' is never used.
  • class member 'JitWriteProtection::_restore' is never used.
  • class member 'OS::page_size' is never used.
  • class member 'OS::page_mask' is never used.
  • The function 'rewind' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'next' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'size' overrides a function in a base class but is not marked with a 'override' specifier.
  • Variable 'entry' can be declared as pointer to const
  • The function 'rewind' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'next' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'size' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'check' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'start' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'enableEvents' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'registerThread' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'unregisterThread' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'interval' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'enableEvents' overrides a function in a base class but is identical to the overridden function
  • The function 'registerThread' overrides a function in a base class but is identical to the overridden function
  • The function 'unregisterThread' overrides a function in a base class but is identical to the overridden function
  • The function 'check' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'start' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'stop' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'registerThread' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'unregisterThread' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'interval' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'name' overrides a function in a base class but is not marked with a 'override' specifier.
  • The function 'enableEvents' overrides a function in a base class but is not marked with a 'override' specifier.
  • class member 'PerfEvents::_max_events' is never used.
  • class member 'PerfEvents::_events' is never used.
  • class member 'PerfEvents::_event_type' is never used.
  • class member 'PerfEvents::_ring' is never used.
  • class member 'PerfEvents::_cstack' is never used.
  • class member 'PerfEvents::_use_mmap_page' is never used.
  • Class 'ReservoirSampler' has a constructor with 1 argument that is not explicit.
  • Class 'UnloadProtection' has a constructor with 1 argument that is not explicit.
  • class member 'Symbols::_libs_limit_reported' is never used.
  • class member 'UnloadProtection::_lib_handle' is never used.
  • Class 'SymbolDesc' has a constructor with 1 argument that is not explicit.
  • Class 'MemoryMapDesc' has a constructor with 1 argument that is not explicit.
  • Local variable 'section' shadows outer function
  • Local variable 'section' shadows outer function
  • Local variable 'section' shadows outer function
  • Variable 'ident' can be declared as pointer to const
  • Parameter 'section' can be declared as pointer to const
  • Variable 'checked' can be declared as pointer to const
  • Variable 'pheader' can be declared as pointer to const
  • Variable 'sym' can be declared as pointer to const
  • Variable 'sym' can be declared as pointer to const
  • Variable 'chain' can be declared as pointer to const
  • Variable 'plt' can be declared as pointer to const
  • Variable 'note' can be declared as pointer to const
  • Variable 'sym' can be declared as pointer to const
  • Parameter 'info' can be declared as pointer to const
  • struct member 'RootSymbolEntry::name' is never used.
  • struct member 'RootSymbolEntry::kind' is never used.
  • class member 'ElfParser::_root_symbols' is never used.
  • Class 'ExclusiveLock' has a constructor with 1 argument that is not explicit.
  • Class 'SharedLock' has a constructor with 1 argument that is not explicit.
  • Same expression on both sides of '-'.
  • Local variable 'count' shadows outer function
  • Parameter 'failures' can be declared as reference to const
  • class member 'ProfiledThread::_buffer_size' is never used.
  • class member 'ProfiledThread::_buffer' is never used.
  • Local variable 'word' shadows outer function
  • class member 'ThreadInfo::_thread_names' is never used.
  • class member 'ThreadInfo::_thread_ids' is never used.
  • Condition 'enabled()' is always false
  • The function 'loadAcquire' is never used.
  • The function 'message' is never used.
  • The function 'hasOption' is never used.
  • The function 'cpuSamplerInterval' is never used.
  • The function 'acquired' is never used.
  • The function 'offset' is never used.
  • The function 'skip' is never used.
  • The function 'put16' is never used.
  • The function 'put64' is never used.
  • The function 'putFloat' is never used.
  • The function 'putVar64' is never used.
  • The function 'findBlobByAddress' is never used.
  • The function 'binarySearch' is never used.
  • The function 'dump' is never used.
  • The function 'findSymbolsByPrefix' is never used.
  • The function 'findImport' is never used.
  • The function 'patchImport' is never used.
  • The function 'findFrameDesc' is never used.
  • The function 'libIndex' is never used.
  • The function 'isMarked' is never used.
  • The function 'minAddress' is never used.
  • The function 'contains' is never used.
  • The function 'get' is never used.
  • The function 'getPage' is never used.
  • The function 'get_tag' is never used.
  • The function 'getCounters' is never used.
  • The function 'getCounter' is never used.
  • The function 'describeCounters' is never used.
  • The function 'units' is never used.
  • The function 'check' is never used.
  • The function 'start' is never used.
  • The function 'supported' is never used.
  • The function 'setSighandlerTid' is never used.
  • The function 'bounded_lookup' is never used.
  • The function 'stop' is never used.
  • The function 'interval' is never used.
  • The function 'enableEvents' is never used.
  • The function 'updateCounter' is never used.
  • The function 'registerThread' is never used.
  • The function 'unregisterThread' is never used.
  • The function 'hasChanged' is never used.
  • The function 'updateNumSamplableThreads' is never used.
  • The function 'updateNumSuccessfulSamples' is never used.
  • The function 'updateNumFailedSamples' is never used.
  • The function 'updateNumExitedThreads' is never used.
  • The function 'updateNumPermissionDenied' is never used.
  • The function 'endEpoch' is never used.
  • The function 'clean' is never used.
  • The function 'newEpoch' is never used.
  • The function 'encode' is never used.
  • The function 'decode' is never used.
  • The function 'threadEntry' is never used.
  • The function 'sampleIdleThreads' is never used.
  • The function 'field' is never used.
  • The function 'category' is never used.
  • The function 'root' is never used.
  • The function 'strings' is never used.
  • The function 'jniExceptionCheck' is never used.
  • The function 'is_readable_pointer' is never used.
  • The function 'used' is never used.
  • The function 'alloc' is never used.
  • The function 'level' is never used.
  • The function 'next' is never used.
  • The function 'cputime' is never used.
  • The function 'micros' is never used.
  • The function 'processStartTime' is never used.
  • The function 'sleep' is never used.
  • The function 'ntoh64' is never used.
  • The function 'threadId' is never used.
  • The function 'schedPolicy' is never used.
  • The function 'threadName' is never used.
  • The function 'listThreads' is never used.
  • The function 'isLinux' is never used.
  • The function 'installSignalHandler' is never used.
  • The function 'replaceSigsegvHandler' is never used.
  • The function 'replaceSigbusHandler' is never used.
  • The function 'sendSignalToThread' is never used.
  • The function 'getCpuDescription' is never used.
  • The function 'getProcessCpuTime' is never used.
  • The function 'getTotalCpuTime' is never used.
  • The function 'copyFile' is never used.
  • The function 'truncateFile' is never used.
  • The function 'fileSize' is never used.
  • The function 'freePageCache' is never used.
  • The function 'mallocArenaMax' is never used.
  • The function 'walkKernel' is never used.
  • The function 'resetBuffer' is never used.
  • The function 'getEventName' is never used.
  • The function 'compute' is never used.
  • The function 'sample' is never used.
  • The function 'is_probably_rust_legacy' is never used.
  • The function 'demangle' is never used.
  • The function 'handle_safefetch' is never used.
  • The function 'safeFetch32' is never used.
  • The function 'safeFetch64' is never used.
  • The function 'load32' is never used.
  • The function 'tryLockShared' is never used.
  • The function 'withinCurrentStack' is never used.
  • The function 'restore' is never used.
  • The function 'stackAt' is never used.
  • The function 'clearParsingCaches' is never used.
  • The function 'parseLibraries' is never used.
  • The function 'isRootSymbol' is never used.
  • The function 'forTid' is never used.
  • The function 'inBuffer' is never used.
  • The function 'tid' is never used.
  • The function 'noteCPUSample' is never used.
  • The function 'lookupWallclockCallTraceId' is never used.
  • The function 'recordCallTraceId' is never used.
  • The function 'enterCrashHandler' is never used.
  • The function 'exitCrashHandler' is never used.
  • The function 'resetCrashHandler' is never used.
  • The function 'isDeepCrashHandler' is never used.
  • The function 'unwindFailures' is never used.
  • The function 'bitmapAddressFor' is never used.
  • The function 'accept' is never used.
  • The function 'remove' is never used.
  • The function 'addressOfSize' is never used.
  • The function 'getThreadId' is never used.
  • The function 'clearAll' is never used.
  • The function 'updateThreadName' is never used.
  • The function 'reportCounters' is never used.
  • The function 'convertJvmExecutionState' is never used.
  • The function 'initialized' is never used.
  • The function 'ticks' is never used.
  • The function 'frequency' is never used.
  • The function 'ticks_to_millis' is never used.
  • The function 'record' is never used.
  • The function 'forEach' is never used.
  • The function 'countFailures' is never used.
  • The function 'collectAndReset' is never used.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jbachorik
jbachorik reviewed Jul 24, 2025
View reviewed changes

@jbachorik jbachorik left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Is it ok to run gtest only when testing Java?
You could then do linkDebug and get *.so file without running gtests. Is this the intention?

For CI I think this does make any difference - the gtests will run a bit later. For local dev, you can use -Pskip-gtest gradle paramater.

The rest of the changes looks good.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@r1viollet

r1viollet commented Jul 24, 2025

Copy link
Copy Markdown
Contributor Author

Is it ok to run gtest only when testing Java? You could then do linkDebug and get *.so file without running gtests. Is this the intention?
...

For me, it is more idiomatic to have tests run in the test step. I found it confusing to have always test that run at every build.
We can still call it explicitly with gtest and they are linked in the testDebug steps.

Though I agree this is a matter of taste.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@r1viollet
Hook gtest to the test command
82afa1e
@r1viollet
r1viollet force-pushed the r1viollet/remove_gtest_during_build branch from 964e71f to 82afa1e Compare July 24, 2025 13:34
@jbachorik

jbachorik commented Jul 24, 2025

Copy link
Copy Markdown
Collaborator

Though I agree this is a matter of taste.

It's mostly about whether we feel it is ok to be able get the library binary without going through the gtest by default.
I have no strong opinion in this case - as long as we run the gtests eventually :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

r1viollet added 3 commits July 28, 2025 09:52
@r1viollet
Add git's safe directory option
8f5d37e
This avoids ownership issues in builds
@r1viollet
Merge branch 'main' of github.com:DataDog/java-profiler into r1violle…
fd9a455
…t/remove_gtest_during_build
@r1viollet
Fix a formatting issue
5204ade
@r1viollet

r1viollet commented Jul 28, 2025

Copy link
Copy Markdown
Contributor Author

I had issues with file ownership on some alpine builds. I'm not sure why I was the only one to see this.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@r1viollet
r1viollet requested a review from jbachorik July 28, 2025 08:06
jbachorik
jbachorik approved these changes Jul 28, 2025
View reviewed changes
@r1viollet
r1viollet merged commit 38a5ddd into main Jul 28, 2025
@r1viollet
r1viollet deleted the r1viollet/remove_gtest_during_build branch July 28, 2025 12:24
@github-actions github-actions Bot added this to the 1.29.0 milestone Jul 28, 2025
@zhengyu123 zhengyu123 mentioned this pull request Jul 28, 2025
Bump ddprof to 1.29.0 DataDog/dd-trace-java#9262
Merged
@zhengyu123 zhengyu123 added the fixed_version: v_1.29.0 Version this PR's fix shipped in label Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jbachorik jbachorik jbachorik approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

fixed_version: v_1.29.0 Version this PR's fix shipped in

Projects

None yet

Milestone

1.29.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@r1viollet @jbachorik @zhengyu123
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.