<commit_before>#include "recorder_control.h"
#include "globals.h"
#include "threads.h"
#include "syscall_modeling.h"
#include "sift_assert.h"
#include "../../include/sim_api.h"

#include <iostream>
#include <stdlib.h>
#include <sys/file.h>
#include <sys/syscall.h>
#include <sys/stat.h>

void beginROI(THREADID threadid)
{
   if (app_id < 0)
      findMyAppId();

   if (any_thread_in_detail)
   {
      std::cerr << "[SIFT_RECORDER:" << app_id << "] Error: ROI_START seen, but we have already started." << std::endl;
   }
   else
   {
      if (verbose)
         std::cerr << "[SIFT_RECORDER:" << app_id << "] ROI Begin" << std::endl;
   }
   any_thread_in_detail = true;

   PIN_RemoveInstrumentation();
}

void endROI(THREADID threadid)
{
   if (KnobEmulateSyscalls.Value())
   {
      // Send SYS_exit_group to the simulator to end the application<commit_msg>[sift_recorder] Fix a GCC 4.7 compile error where unlink() requires the appropriate header to be included<commit_after>#include "recorder_control.h"
#include "globals.h"
#include "threads.h"
#include "syscall_modeling.h"
#include "sift_assert.h"
#include "../../include/sim_api.h"

#include <iostream>
#include <stdlib.h>
#include <sys/file.h>
#include <sys/syscall.h>
#include <sys/stat.h>
#include <unistd.h>

void beginROI(THREADID threadid)
{
   if (app_id < 0)
      findMyAppId();

   if (any_thread_in_detail)
   {
      std::cerr << "[SIFT_RECORDER:" << app_id << "] Error: ROI_START seen, but we have already started." << std::endl;
   }
   else
   {
      if (verbose)
         std::cerr << "[SIFT_RECORDER:" << app_id << "] ROI Begin" << std::endl;
   }
   any_thread_in_detail = true;

   PIN_RemoveInstrumentation();
}

void endROI(THREADID threadid)
{
   if (KnobEmulateSyscalls.Value())
   {
      // Send SYS_exit_group to the simulator to end the application
{'fraction_non_alphanumeric': 0.14961915125136016, 'fraction_numerical': 0.002176278563656148, 'mean_word_length': 3.7396907216494846, 'pattern_counts': {'":': 0, '<': 48, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '4900369', 'n_tokens_mistral': 698, 'n_tokens_neox': 670, 'n_words': 154}