<commit_before>#include "trace_rtn.h"
#include "globals.h"
#include "threads.h"

static void routineEnter(THREADID threadid, ADDRINT eip, ADDRINT esp)
{
   if (thread_data[threadid].output)
   {
      thread_data[threadid].output->RoutineChange(eip, esp, Sift::RoutineEnter);
      thread_data[threadid].last_routine = eip;
   }
}

static void routineExit(THREADID threadid, ADDRINT eip, ADDRINT esp)
{
   if (thread_data[threadid].output)
   {
      thread_data[threadid].output->RoutineChange(eip, esp, Sift::RoutineExit);
      thread_data[threadid].last_routine = -1;
   }
}

static void routineAssert(THREADID threadid, ADDRINT eip, ADDRINT esp)
{
   if (thread_data[threadid].output && thread_data[threadid].last_routine != eip)
   {
      thread_data[threadid].output->RoutineChange(eip, esp, Sift::RoutineAssert);
      thread_data[threadid].last_routine = eip;
   }
}

static void announceRoutine(RTN rtn)
{
   if (!thread_data[PIN_ThreadId()].output)
      return;

   routines[RTN_Address(rtn)] = true;

   INT32 column = 0, line = 0;
   std::string filename = "??";<commit_msg>[sift] Only send function call/return notifications in detailed mode to avoid slowing down fast-forwarding<commit_after>#include "trace_rtn.h"
#include "globals.h"
#include "threads.h"

static void routineEnter(THREADID threadid, ADDRINT eip, ADDRINT esp)
{
   if (any_thread_in_detail && thread_data[threadid].output)
   {
      thread_data[threadid].output->RoutineChange(eip, esp, Sift::RoutineEnter);
      thread_data[threadid].last_routine = eip;
   }
}

static void routineExit(THREADID threadid, ADDRINT eip, ADDRINT esp)
{
   if (any_thread_in_detail && thread_data[threadid].output)
   {
      thread_data[threadid].output->RoutineChange(eip, esp, Sift::RoutineExit);
      thread_data[threadid].last_routine = -1;
   }
}

static void routineAssert(THREADID threadid, ADDRINT eip, ADDRINT esp)
{
   if (any_thread_in_detail && thread_data[threadid].output && thread_data[threadid].last_routine != eip)
   {
      thread_data[threadid].output->RoutineChange(eip, esp, Sift::RoutineAssert);
      thread_data[threadid].last_routine = eip;
   }
}

static void announceRoutine(RTN rtn)
{
   if (!thread_data[PIN_ThreadId()].output)
      return;

   routines[RTN_Address(rtn)] = true;

   INT32 column = 0, line = 0;
   std::string filename = "??";
{'fraction_non_alphanumeric': 0.12633376013657704, 'fraction_numerical': 0.004268032437046522, 'mean_word_length': 4.661835748792271, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '4481776', 'n_tokens_mistral': 846, 'n_tokens_neox': 831, 'n_words': 154}