git-svn-id: http://ltt.polymtl.ca/svn@494 04897980-b3bd-0310-b5e0-8ef037075253
[lttv.git] / ltt / branches / poly / ltt / tracefile.c
index 0af8976a170b4f6537f5139d63c4bb5e33950b67..fdc37919dc0a2aeddea8c3ad86eb91f076c9e0af 100644 (file)
@@ -1,3 +1,21 @@
+/* This file is part of the Linux Trace Toolkit viewer
+ * Copyright (C) 2003-2004 Xiangxiu Yang
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, 
+ * MA 02111-1307, USA.
+ */
+
 #include <stdio.h>
 #include <fcntl.h>
 #include <sys/stat.h>
@@ -349,7 +367,8 @@ void getCpuFileInfo(LttTrace *t, char* cpu)
 
   while((entry = readdir(dir)) != NULL){
     if(strcmp(entry->d_name,".") != 0 &&
-       strcmp(entry->d_name,"..") != 0 ){
+       strcmp(entry->d_name,"..") != 0 &&
+       strcmp(entry->d_name,".svn") != 0){      
       strcpy(name,cpu);
       strcat(name,entry->d_name);
       ltt_tracefile_open_cpu(t,name);
@@ -365,6 +384,10 @@ void getCpuFileInfo(LttTrace *t, char* cpu)
  *
  *When a trace is closed, all the associated facilities, types and fields
  *are released as well.
+ *
+ * MD : If pathname is already absolute, we do not add current working
+ * directory to it.
+ *
  ****************************************************************************/
 
 void get_absolute_pathname(const char *pathname, char * abs_pathname)
@@ -372,11 +395,19 @@ void get_absolute_pathname(const char *pathname, char * abs_pathname)
   char * ptr, *ptr1;
   size_t size = DIR_NAME_SIZE;
   abs_pathname[0] = '\0';
+
+       if(pathname[0] == '/')
+       {
+    strcat(abs_pathname, pathname);
+               return;
+       }
+
   if(!getcwd(abs_pathname, size)){
     g_warning("Can not get current working directory\n");
     strcat(abs_pathname, pathname);
     return;
   }
+
   strcat(abs_pathname,"/");
   
   ptr = (char*)pathname;
@@ -1155,8 +1186,8 @@ LttTime getEventTime(LttTracefile * tf)
   tf->pre_cycle_count = cycle_count;
   cycle_count += tmpCycleCount * tf->count;  
   
-  if(tf->cur_heart_beat_number > tf->count)
-    cycle_count += tmpCycleCount * (tf->cur_heart_beat_number - tf->count);  
+  //  if(tf->cur_heart_beat_number > tf->count)
+  //    cycle_count += tmpCycleCount * (tf->cur_heart_beat_number - tf->count);  
 
   tf->cur_cycle_count = cycle_count;
 
This page took 0.026784 seconds and 4 git commands to generate.