Below is the list of changes that have just been committed into a local
6.0-falcon repository of . When does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-07-12 17:54:57-04:00, jas@rowvwade. +4 -0
Second rev of gdb backtrace snapshot tool.
storage/falcon/snapshot/Snapshot.cpp@stripped, 2007-07-12 17:54:49-04:00, jas@rowvwade. +25 -4
Second rev of gdb backtrace snapshot tool.
storage/falcon/snapshot/Snapshot.h@stripped, 2007-07-12 17:54:49-04:00, jas@rowvwade. +3 -0
Second rev of gdb backtrace snapshot tool.
storage/falcon/snapshot/Thread.cpp@stripped, 2007-07-12 17:54:49-04:00, jas@rowvwade. +32 -3
Second rev of gdb backtrace snapshot tool.
storage/falcon/snapshot/Thread.h@stripped, 2007-07-12 17:54:50-04:00, jas@rowvwade. +2 -0
Second rev of gdb backtrace snapshot tool.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jas
# Host: rowvwade.
# Root: D:/MySQL/mysql-5.1-falcon
--- 1.1/storage/falcon/snapshot/Snapshot.cpp 2007-07-12 17:55:17 -04:00
+++ 1.2/storage/falcon/snapshot/Snapshot.cpp 2007-07-12 17:55:17 -04:00
@@ -23,6 +23,8 @@
"PageWriter::writer",
"SerialLog::gopherThread",
"Scheduler::schedule",
+ "handle_connections_sockets",
+ "Table::retireRecords",
NULL
};
@@ -34,7 +36,6 @@
{
inputFile = NULL;
threads = NULL;
-
}
Snapshot::~Snapshot()
@@ -45,8 +46,9 @@
void Snapshot::analyze(const char *fileName)
{
close();
-
- if ( !(inputFile = fopen(fileName, "r")) )
+ lineNumber = 0;
+
+ if ( !(inputFile = fopen(fileName, "rt")) )
{
perror(fileName);
@@ -80,6 +82,7 @@
{
++unaccounted;
printf("Thread %d unknown\n", thread->threadNumber);
+ thread->printTrace(" ");
}
}
@@ -112,5 +115,23 @@
const char* Snapshot::getLine()
{
- return fgets(buffer, sizeof(buffer), inputFile);
+ if (!fgets(buffer, sizeof(buffer), inputFile))
+ return NULL;
+
+ ++lineNumber;
+
+ return buffer;
+}
+
+long Snapshot::getFileOffset()
+{
+ return lineNumber;
+}
+
+void Snapshot::seek(long position)
+{
+ rewind(inputFile);
+
+ for (long n = 0; n < position; ++n)
+ getLine();
}
--- 1.1/storage/falcon/snapshot/Snapshot.h 2007-07-12 17:55:17 -04:00
+++ 1.2/storage/falcon/snapshot/Snapshot.h 2007-07-12 17:55:17 -04:00
@@ -20,6 +20,8 @@
class Snapshot
{
public:
+ void seek (long position);
+ long getFileOffset();
const char* getLine();
void close();
void analyze (const char *fileName);
@@ -28,6 +30,7 @@
FILE *inputFile;
Thread *threads;
+ int lineNumber;
char buffer[1024];
};
--- 1.1/storage/falcon/snapshot/Thread.cpp 2007-07-12 17:55:17 -04:00
+++ 1.2/storage/falcon/snapshot/Thread.cpp 2007-07-12 17:55:17 -04:00
@@ -53,7 +53,13 @@
// Find thread definition line
- while ( (text = snapshot->getLine()) )
+ for (;;)
+ {
+ start = snapshot->getFileOffset();
+
+ if ( !(text = snapshot->getLine()) )
+ return false;
+
if (match("Thread "))
{
threadNumber = getInt();
@@ -65,9 +71,8 @@
break;
}
}
+ }
- if (!text)
- return false;
// Looking for something familiar
@@ -103,4 +108,28 @@
text = start;
return false;
+}
+
+void Thread::printTrace(const char *prefix)
+{
+ snapshot->seek(start);
+
+ if ( !(text = snapshot->getLine()) )
+ return;
+
+ printf("%s%s", prefix, text);
+
+ for (;;)
+ {
+ if ( !(text = snapshot->getLine()) )
+ return;
+
+ if (text[0] != '#' && text[0] != ' ')
+ break;
+
+ printf("%s%s", prefix, text);
+ }
+
+ printf("\n");
+
}
--- 1.1/storage/falcon/snapshot/Thread.h 2007-07-12 17:55:17 -04:00
+++ 1.2/storage/falcon/snapshot/Thread.h 2007-07-12 17:55:17 -04:00
@@ -14,6 +14,7 @@
class Thread
{
public:
+ void printTrace(const char* prefix);
bool find (const char *pattern);
bool parse(const char **knownMethods);
int getInt();
@@ -27,6 +28,7 @@
int threadNumber;
int threadId;
int methodIndex;
+ long start;
};
#endif // !defined(AFX_THREAD_H__664784B4_27B7_45BF_A6D1_A7E438066E15__INCLUDED_)
| Thread |
|---|
| • bk commit into 6.0-falcon tree (jas:1.2628) | U-ROWVWADEjas | 12 Jul |