Hi there,
I have some problem when trying to record traces from pthread programs.
I'm using
./record-trace -o hellotrace -- ./helloworld
And get the following error
In main: creating thread 0
[SIFT_RECORDER] recorder_control.cc:172: void openFile(LEVEL_VM::THREADID): Assertion `KnobUseResponseFiles.Value() != 0' failed.
Pin app terminated abnormally due to signal 6.
I used the following command to compilation.
g++ -o helloworld helloworld.cpp
-I/home/w/Qin/sniper/sniper-5.2/include
-L/home/w/Qin/sniper/sniper-5.2/lib -lm -pthread -static
The helloworld.cpp is listed as follows.
Thanks
BR
Xiaohang
/******************************************************************************
* FILE: hello.c
* DESCRIPTION:
* A "hello world" Pthreads program. Demonstrates thread creation and
* termination.
* AUTHOR: Blaise Barney
* LAST REVISED: 08/09/11
******************************************************************************/
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include "sim_api.h"
using namespace std;
#define NUM_THREADS 5
void *PrintHello(void *threadid)
{
long tid;
tid = (long)threadid;
printf("Hello World! It's me, thread #%ld!\n", tid);
pthread_exit(NULL);
}
int main(int argc, char *argv[])
{
pthread_t threads[NUM_THREADS];
int rc;
long t;
vector <int> ss;
ss.push_back(33);
printf("number is %d \n", ss[0]);
SimRoiStart();
for(t=0;t<NUM_THREADS;t++){
printf("In main: creating thread %ld\n", t);
rc = pthread_create(&threads[t], NULL, PrintHello, (void *)t);
//SimRoiStart();
if (rc){
printf("ERROR; return code from pthread_create() is %d\n", rc);
exit(-1);
}
// SimRoiEnd();
}
/* Last thing that main() should do */
//pthread_exit(NULL);
SimRoiEnd();
}