LLVM API Documentation
00001 //===- RSProfiling.cpp - Various profiling using random sampling ----------===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file defines the abstract interface that a profiler must implement to 00011 // support the random profiling transform. 00012 // 00013 //===----------------------------------------------------------------------===// 00014 00015 #ifndef LLVM_TRANSFORMS_RSPROFILING_H 00016 #define LLVM_TRANSFORMS_RSPROFILING_H 00017 00018 namespace llvm { 00019 //===--------------------------------------------------------------------===// 00020 /// RSProfilers - The basic Random Sampling Profiler Interface Any profiler 00021 /// that implements this interface can be transformed by the random sampling 00022 /// pass to be sample based rather than always on. 00023 /// 00024 /// The only exposed function can be queried to find out if an instruction 00025 /// was original or if it was inserted by the profiler. Implementations of 00026 /// this interface are expected to chain to other implementations, such that 00027 /// multiple profilers can be support simultaniously. 00028 struct RSProfilers : public ModulePass { 00029 static char ID; // Pass identification, replacement for typeinfo 00030 RSProfilers() : ModulePass(&ID) {} 00031 00032 /// isProfiling - This method returns true if the value passed it was 00033 /// inserted by the profiler. 00034 virtual bool isProfiling(Value* v) = 0; 00035 }; 00036 } 00037 00038 #endif
This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.