From 26d9039b6c71d41c43507a17e58912f0f9baa08f Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Thu, 26 Sep 2019 16:31:19 +0900 Subject: [PATCH] enable profile if MCL_PROF=2 --- src/fp_generator.hpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/fp_generator.hpp b/src/fp_generator.hpp index 6185bb0..2576cab 100644 --- a/src/fp_generator.hpp +++ b/src/fp_generator.hpp @@ -268,9 +268,16 @@ private: // printf("p=%p, pn_=%d, isFullBit_=%d\n", p_, pn_, isFullBit_); #ifdef MCL_USE_PROF static char suf[] = "_0"; - const char *s = getenv("MCL_PROF"); - if (s && s[0] && s[1] == '\0') { - prof_.init(s[0] - '0'); + int profMode = 0; +#ifdef XBYAK_USE_VTUNE + profMode = 2; +#endif + { + const char *s = getenv("MCL_PROF"); + if (s && s[0] && s[1] == '\0') profMode = s[0] - '0'; + } + if (profMode) { + prof_.init(profMode); prof_.setStartAddr(getCurr()); prof_.setNameSuffix(suf); suf[1]++;