I am trying to get a trace of LLC/L3 accesses in a text file by using the basic file operations as shown below-
***************************************************************************************************
void CacheCntlr::accessCache(
Core::mem_op_t mem_op_type, IntPtr ca_address, UInt32 offset,
Byte* data_buf, UInt32 data_length, bool update_replacement)
{
ofstream myfile;
switch (mem_op_type)
{
case Core::READ:
case Core::READ_EX:
if(! m_next_cache_cntlr)
{
/****** Getting accesses to LLC in myfile **********/
myfile.open ("example2.txt", fstream::out | fstream::app);
myfile << ca_address << "\t" << ShmemPerfModel::_USER_THREAD << "\n";
myfile.close();
}
*****************************************************************************************************
I inserted the above code snippet in "cache_cntlr.cpp" file under the function "void CacheCntlr::accessCache()" to get the LLC access trace. However, the text file named "example2.txt" is not getting created. Could you please help me with this?