perf does not recognize too short function name
diff --git a/sample/profiler.cpp b/sample/profiler.cpp
index 772e5c5..dc15d9b 100644
--- a/sample/profiler.cpp
+++ b/sample/profiler.cpp
@@ -6,7 +6,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
-#define XBYAK_NO_OP_NAMES
 #include <xbyak/xbyak_util.h>
 
 const int N = 3000000;
@@ -70,9 +69,6 @@
 	Xbyak::util::Profiler prof;
 	printf("mode=%d\n", mode);
 	prof.init(mode);
-	/*
-		func name must have three characters
-	*/
 	prof.set("f", (const void*)f, c.getSize());
 	prof.set("g", (const void*)g, c2.getSize());
 
diff --git a/xbyak/xbyak_util.h b/xbyak/xbyak_util.h
index 91b2e21..4f79d8f 100644
--- a/xbyak/xbyak_util.h
+++ b/xbyak/xbyak_util.h
@@ -1,5 +1,6 @@
 #ifndef XBYAK_XBYAK_UTIL_H_
 #define XBYAK_XBYAK_UTIL_H_
+#include <string.h>
 
 /**
 	utility class and functions for Xbyak
@@ -759,7 +760,7 @@
 	};
 	Profiler()
 		: mode_(None)
-		, suffix_(0)
+		, suffix_("")
 		, startAddr_(0)
 #ifdef XBYAK_USE_PERF
 		, fp_(0)
@@ -833,7 +834,16 @@
 #ifdef XBYAK_USE_PERF
 		if (mode_ == Perf) {
 			if (fp_ == 0) return;
-			fprintf(fp_, "%llx %zx %s%s\n", (long long)startAddr, funcSize, funcName, suffix_);
+			fprintf(fp_, "%llx %zx %s%s", (long long)startAddr, funcSize, funcName, suffix_);
+			/*
+				perf does not recognize the function name which is less than 3,
+				so append '_' at the end of the name if necessary
+			*/
+			size_t n = strlen(funcName) + strlen(suffix_);
+			for (size_t i = n; i < 3; i++) {
+				fprintf(fp_, "_");
+			}
+			fprintf(fp_, "\n");
 			fflush(fp_);
 		}
 #endif