search for: hookfunc

Displaying 10 results from an estimated 10 matches for "hookfunc".

2013 Jan 16
2
[LLVMdev] Dynamic Profiling - Instrumentation basic query
...ment and call an external function, but faced an issue while passing an argument to the function. I am following EdgeProfiling.cpp but couldn't figure out the problem. Could you please see where I am going wrong here - virtual bool runOnModule(Module &M) { Constant *hookFunc; LLVMContext& context = M.getContext(); hookFunc = M.getOrInsertFunction("cacheCounter",Type::getVoidTy(M.getContext()), llvm::Type::getInt32Ty(M.getContext()),...
2013 Jan 20
0
[LLVMdev] Dynamic Profiling - Instrumentation basic query
..., but faced an issue > while passing an argument to the function. I am following EdgeProfiling.cpp > but couldn't figure out the problem. Could you please see where I am going > wrong here - > > virtual bool runOnModule(Module &M) > { > Constant *hookFunc; > LLVMContext& context = M.getContext(); > hookFunc = > M.getOrInsertFunction("cacheCounter",Type::getVoidTy(M.getContext()), > > llvm::Type::getInt32Ty(M.getContext()), > (Type*)...
2013 Jan 15
0
[LLVMdev] Dynamic Profiling - Instrumentation basic query
Hi Silky, On 14/01/13 01:47, Silky Arora wrote: > I need to profile the code for branches (branch mis predicts > simulation), load/store instructions (for cache hits/miss rate), and a > couple of other things and therefore, would need to instrument the code. > However, I would like to know if writing the output to a file would > increase the execution time, or is it the profiling
2013 Jan 14
2
[LLVMdev] Dynamic Profiling - Instrumentation basic query
Hi, @Alastair: Thanks a bunch for explaining this so well. I was able to write a simple profiler, and run it. I need to profile the code for branches (branch mis predicts simulation), load/store instructions (for cache hits/miss rate), and a couple of other things and therefore, would need to instrument the code. However, I would like to know if writing the output to a file would increase the
2011 Nov 19
2
[LLVMdev] Insert a function call in the code
...ert() : ModulePass(ID) {} virtual bool runOnModule(Module &M) { // Function *F = M.getFunction("sleep"); // hook = Function::Create(F->getFunctionType(), GlobalValue::ExternalLinkage, "hook", F->getParent()); Constant *hookFunc; hookFunc = M.getOrInsertFunction("hook", Type::getVoidTy(M.getContext()), Type::getVoidTy(M.getContext()), (Type*)0); hook= cast<Function>(hookFunc); for(Module::iterator F = M.begin(), E = M.end(); F!= E; ++F) { f...
2013 Jan 27
1
[LLVMdev] Passing an array to an external function
...ed passing the array directly using and changing the getorInsertFunction accordingly but this didn't work. It fails with Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"' failed. hookFunc = M.getOrInsertFunction("hook", Type::getVoidTy(M.getContext()), llvm::ArrayType::get(llvm::Type::getInt32Ty(M.getContext()),2), (Type*)0); ..... Args[0] = ConstantArray::get(llvm::ArrayType::get(llvm::Type::getInt32Ty(BI->getContext()),2), arr); I tried using index 0 in the GEP, bu...
2013 Jan 27
0
[LLVMdev] Passing an array to an external function
On Jan 26, 2013, at 19:24 , SArora <silkyar at umich.edu> wrote: > Hi all, > > I am new to LLVM, and I am learning how to use LLVM for profiling. I need to > pass an array to an external method, and insert a call instruction to the > method in the code. > > After reading a few source files, I've tried using GetElementPtrInst to pass > an array, but it fails at
2011 Nov 20
0
[LLVMdev] Insert a function call in the code
..., you need to pass the appropriate integer type when > you create the function. > > Ciao, Duncan. > > > > > > > > > 2011/11/19 Duncan Sands <baldrick at free.fr <mailto:baldrick at free.fr>> > > > > Hi 赵夏, > > > > > hookFunc = M.getOrInsertFunction("hook", > > > Type::getVoidTy(M.getContext()), Type::getVoidTy(M.getContext()), > (Type*)0); > > > > try removing the second Type::getVoidTy. Your function doesn't take > any > > parameters, so you should simply pas...
2013 Jan 27
2
[LLVMdev] Passing an array to an external function
Hi all, I am new to LLVM, and I am learning how to use LLVM for profiling. I need to pass an array to an external method, and insert a call instruction to the method in the code. After reading a few source files, I've tried using GetElementPtrInst to pass an array, but it fails at llvm::GetElementPtrInst::hasAllZeroIndices() const + 0 std::vector<Value*> Args(1);
2011 Nov 21
0
[LLVMdev] How to get ELF section virtual starting address from MCSymbolRefExpr?
...you need to pass the appropriate integer type when > you create the function. > > Ciao, Duncan. > > > > > > > > > 2011/11/19 Duncan Sands <baldrick at free.fr <mailto:baldrick at free.fr>> > > > > Hi ????, > > > > > hookFunc = M.getOrInsertFunction("hook", > > > Type::getVoidTy(M.getContext()), Type::getVoidTy(M.getContext()), > (Type*)0); > > > > try removing the second Type::getVoidTy. Your function doesn't take > any > > parameters, so you should simply pas...