From: vladimir.mezentsev@oracle.com
To: binutils@sourceware.org
Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without java support
Date: Wed, 17 Aug 2022 19:59:18 -0700 [thread overview]
Message-ID: <20220818025918.1435262-1-vladimir.mezentsev@oracle.com> (raw)
From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
gprofng/ChangeLog
2022-08-17 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
PR gprofng/29479
* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
java specific code.
* libcollector/unwind.c: Likewise.
---
gprofng/libcollector/collector.c | 2 ++
gprofng/libcollector/unwind.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
index 93c9d3330de..ceff2c1cacc 100644
--- a/gprofng/libcollector/collector.c
+++ b/gprofng/libcollector/collector.c
@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
__collector_ext_unwind_key_init (1, NULL);
/* start java attach if suitable */
+#if defined(GPROFNG_JAVA_PROFILING)
if (exp_origin == SP_ORIGIN_DBX_ATTACH)
__collector_jprofile_start_attach ();
+#endif
start_sec_time = CALL_UTIL (time)(NULL);
__collector_start_time = collector_interface.getHiResTime ();
TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
index 11924378802..f8e11823c81 100644
--- a/gprofng/libcollector/unwind.c
+++ b/gprofng/libcollector/unwind.c
@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
int size = max_frame_size;
#define MIN(a,b) ((a)<(b)?(a):(b))
+#if defined(GPROFNG_JAVA_PROFILING)
/* get Java info */
if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
{
@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
size -= sz;
}
}
+#endif
/* get native stack */
if (context)
--
2.27.0
reply other threads:[~2022-08-18 2:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220818025918.1435262-1-vladimir.mezentsev@oracle.com \
--to=vladimir.mezentsev@oracle.com \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).