<commit_before>--- tools/profiler/core/platform.h
+++ tools/profiler/core/platform.h
@@ -29,6 +29,8 @@
 #ifndef TOOLS_PLATFORM_H_
 #define TOOLS_PLATFORM_H_
 
+#include <sys/types.h>
+
 #include <stdint.h>
 #include <math.h>
 #include "MainThreadUtils.h"
--- tools/profiler/lul/LulElf.cpp
+++ tools/profiler/lul/LulElf.cpp
@@ -579,10 +579,10 @@
 // Return the non-directory portion of FILENAME: the portion after the
 // last slash, or the whole filename if there are no slashes.
 string BaseFileName(const string &filename) {
-  // Lots of copies!  basename's behavior is less than ideal.
-  char *c_filename = strdup(filename.c_str());
-  string base = basename(c_filename);
-  free(c_filename);
+  // basename's behavior is less than ideal so avoid it
+  const char *c_filename = filename.c_str();
+  const char *p = strrchr(c_filename, '/');
+  string base = p ? p+1 : c_filename;
   return base;
 }
 <commit_msg>icecat: fix musl<commit_after>--- tools/profiler/core/platform.h
+++ tools/profiler/core/platform.h
@@ -29,6 +29,8 @@
 #ifndef TOOLS_PLATFORM_H_
 #define TOOLS_PLATFORM_H_
 
+#include <sys/types.h>
+
 #include <stdint.h>
 #include <math.h>
 #include "MainThreadUtils.h"
--- tools/profiler/lul/LulElf.cpp
+++ tools/profiler/lul/LulElf.cpp
@@ -579,10 +579,10 @@
 // Return the non-directory portion of FILENAME: the portion after the
 // last slash, or the whole filename if there are no slashes.
 string BaseFileName(const string &filename) {
-  // Lots of copies!  basename's behavior is less than ideal.
-  char *c_filename = strdup(filename.c_str());
-  string base = basename(c_filename);
-  free(c_filename);
+  // basename's behavior is less than ideal so avoid it
+  const char *c_filename = filename.c_str();
+  const char *p = strrchr(c_filename, '/');
+  string base = p ? p+1 : c_filename;
   return base;
 }
 
--- tools/profiler/core/platform-linux.cc	2017-05-04 23:35:47.000000000 +0200
+++ tools/profiler/core/platform-linux.cc	2017-06-16 10:42:15.942410094 +0200
@@ -683,11 +683,13 @@
 void TickSample::PopulateContext(void* aContext)
 {
   MOZ_ASSERT(aContext);
+#if defined(__GLIBC__)
   ucontext_t* pContext = reinterpret_cast<ucontext_t*>(aContext);
   if (!getcontext(pContext)) {
     context = pContext;
     SetSampleContext(this, aContext);
   }
+#endif
 }
 
 void OS::SleepMicro(int microseconds)
{'fraction_non_alphanumeric': 0.14719726144629866, 'fraction_numerical': 0.04193410355156183, 'mean_word_length': 4.038793103448276, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3001702', 'n_tokens_mistral': 927, 'n_tokens_neox': 858, 'n_words': 203}