projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Initial commit for control flow view
[lttv.git]
/
lttv
/
lttv
/
traceset-process.c
diff --git
a/lttv/lttv/traceset-process.c
b/lttv/lttv/traceset-process.c
index 8ce68981882dd0d76c5a441ab9a845aa9043bbbc..b49542f9fb7aea400464c472fbb562f6931fdc49 100644
(file)
--- a/
lttv/lttv/traceset-process.c
+++ b/
lttv/lttv/traceset-process.c
@@
-79,7
+79,7
@@
guint lttv_process_traceset_middle(LttvTraceset *traceset,
break;
}
break;
}
- currentPos = lttv_traceset_create_position(traceset);
+ currentPos = lttv_traceset_create_
current_
position(traceset);
if(lttv_traceset_position_compare(currentPos,end_position ) == 0){
lttv_traceset_destroy_position(currentPos);
break;
if(lttv_traceset_position_compare(currentPos,end_position ) == 0){
lttv_traceset_destroy_position(currentPos);
break;
@@
-214,7
+214,6
@@
guint lttv_process_traceset_seek_n_forward(LttvTraceset *traceset,
LttvFilter *filter3,
gpointer data)
{
LttvFilter *filter3,
gpointer data)
{
- struct bt_ctf_event *bt_event;
unsigned count = 0;
while(count < n) {
if(bt_iter_next(bt_ctf_get_iter(traceset->iter)) < 0) {
unsigned count = 0;
while(count < n) {
if(bt_iter_next(bt_ctf_get_iter(traceset->iter)) < 0) {
@@
-239,16
+238,19
@@
guint lttv_process_traceset_seek_n_backward(LttvTraceset *ts,
guint i, count, ret;
gint extraEvent = 0;
guint64 initialTimeStamp, previousTimeStamp;
guint i, count, ret;
gint extraEvent = 0;
guint64 initialTimeStamp, previousTimeStamp;
- LttvTracesetPosition *initialPos, *previousPos, *currentPos;
-
+ LttvTracesetPosition *initialPos, *previousPos, *currentPos, beginPos;
+ struct bt_iter_pos pos;
+ beginPos.bt_pos = &pos;
+ beginPos.iter = ts->iter;
+ beginPos.bt_pos->type = BT_SEEK_BEGIN;
/*Save initial position of the traceset*/
/*Save initial position of the traceset*/
- initialPos = lttv_traceset_create_position (ts);
+ initialPos = lttv_traceset_create_
current_
position (ts);
/*Get the timespan of the initial position*/
initialTimeStamp = lttv_traceset_position_get_timestamp(initialPos);
/*
* Create a position before the initial timestamp according
/*Get the timespan of the initial position*/
initialTimeStamp = lttv_traceset_position_get_timestamp(initialPos);
/*
* Create a position before the initial timestamp according
- * to the ratio of nanosecond/
nanosecond
hopefully before the
+ * to the ratio of nanosecond/
event
hopefully before the
* the desired seek position
*/
while(1){
* the desired seek position
*/
while(1){
@@
-259,25
+261,32
@@
guint lttv_process_traceset_seek_n_backward(LttvTraceset *ts,
break;
currentPos = lttv_traceset_create_time_position(ts,ltt_time_from_uint64(previousTimeStamp));
break;
currentPos = lttv_traceset_create_time_position(ts,ltt_time_from_uint64(previousTimeStamp));
+ /*Corner case: When we are near the beginning of the trace and the previousTimeStamp is before
+ * the beginning of the trace. We have to seek to the first event.
+ */
+ if((lttv_traceset_position_compare(currentPos,&beginPos ) == 0)){
+ lttv_traceset_seek_to_position(&beginPos);
+ break;
+ }
/*move traceset position */
/*move traceset position */
- lttv_
traceset_seek_to_position(
previousPos);
+ lttv_
state_traceset_seek_position(ts,
previousPos);
/* iterate to the initial position counting the number of event*/
count = 0;
do {
if((ret = lttv_traceset_position_compare(currentPos,initialPos)) == 1){
bt_iter_next(bt_ctf_get_iter(ts->iter));
lttv_traceset_destroy_position(currentPos);
/* iterate to the initial position counting the number of event*/
count = 0;
do {
if((ret = lttv_traceset_position_compare(currentPos,initialPos)) == 1){
bt_iter_next(bt_ctf_get_iter(ts->iter));
lttv_traceset_destroy_position(currentPos);
- currentPos = lttv_traceset_create_position(ts);
+ currentPos = lttv_traceset_create_
current_
position(ts);
count++;
}
}while(ret != 0);
count++;
}
}while(ret != 0);
- lttv_traceset_destroy_position(currentPos);
+
/*substract the desired number of event to the count*/
extraEvent = count - n;
/*substract the desired number of event to the count*/
extraEvent = count - n;
- if
(extraEvent >= 0)
{
+ if
(extraEvent >= 0)
{
//if the extraEvent is over 0 go back to previousPos and
//move forward the value of extraEvent times
//if the extraEvent is over 0 go back to previousPos and
//move forward the value of extraEvent times
- lttv_
traceset_seek_to_position(
previousPos);
+ lttv_
state_traceset_seek_position(ts,
previousPos);
for(i = 0 ; i < extraEvent ; i++){
if(bt_iter_next(bt_ctf_get_iter(ts->iter)) < 0){
for(i = 0 ; i < extraEvent ; i++){
if(bt_iter_next(bt_ctf_get_iter(ts->iter)) < 0){
@@
-288,9
+297,11
@@
guint lttv_process_traceset_seek_n_backward(LttvTraceset *ts,
}
break; /* we successfully seeked backward */
}
}
break; /* we successfully seeked backward */
}
- else{ /* if the extraEvent is below 0 create a position before and start over*/
- ratio = ratio * 16;
+ else{
+ /* if the extraEvent is below 0 create a position before and start over*/
+ ratio = ratio * 16;
}
}
+ lttv_traceset_destroy_position(currentPos);
}
return 0;
}
}
return 0;
}
This page took
0.024621 seconds
and
4
git commands to generate.