예제 #1
0
 public bool show_entry(Entry entry)
 {
     return(show_thread(entry.record.exec, entry.record.tid));
 }
예제 #2
0
 public bool show_entry(Entry entry)
 {
     return(f1.show_entry(entry) && f2.show_entry(entry));
 }
예제 #3
0
 public bool show_entry(Entry entry)
 {
     return(true);
 }
예제 #4
0
 public bool show_entry(Entry entry)
 {
     return(entry.first_in_block || entry.last_in_block);
 }
예제 #5
0
        // create entry, or create or modify EventRecord
        public void ProcessTuple(int tid, int nr, int attr, String value)
        {
            // make sure thread is known
            ThreadData t;

            if (!cur_execdata.threads.ContainsKey(tid))
            {
                t = cur_execdata.threads[tid] = new ThreadData(tid);
            }
            else
            {
                t = cur_execdata.threads[tid];
            }

            // update max nr
            if (nr > t.max_nr)
            {
                t.max_nr = nr;
            }

            // find or create event record
            EventRecordImpl rec;

            if (t.events.ContainsKey(nr))
            {
                rec = t.events[nr];
            }
            else
            {
                rec          = new EventRecordImpl(this, cur_exec, tid, nr);
                t.events[nr] = rec;
            }

            // update the attribute
            EventAttributeEnum attribute = (EventAttributeEnum)attr;

            rec.set_attribute(attribute, value);

            if (attribute == EventAttributeEnum.STATUS)
            {
                int   seqno = entries.Count + 1;
                Entry entry = new Entry(rec, value, seqno);
                entries[seqno] = entry;
                cur_execdata.sequence.Add(entry);
                rec.entries.Add(entry);
                // default timestamp to last timestamp
                if (rec.hbStamp == null)
                {
                    rec.hbStamp = t.last_stamp;
                }
                // update first/last in block
                if (cur_execdata.last_thread != rec.tid)
                {
                    entry.first_in_block = true;
                    if (cur_execdata.last_entry != null)
                    {
                        cur_execdata.last_entry.last_in_block = true;
                    }
                }
                cur_execdata.last_thread = rec.tid;
                cur_execdata.last_entry  = entry;
                // notify observers
                if (NewEntry != null)
                {
                    NewEntry(entry);
                }
                // set selection to first entry if not set yet
                if (seqno == 1 && selection == -1)
                {
                    SetSelection(1);
                }
            }
            else if (attribute == EventAttributeEnum.THREADNAME)
            {
                if (t.name != value)
                {
                    t.name = value;
                    // notify observers
                    if (ThreadnameUpdate != null)
                    {
                        ThreadnameUpdate(cur_exec, tid, value);
                    }
                }
            }
            else
            {
                if (attribute == EventAttributeEnum.DISPLAY_BOXED)
                {
                    cur_execdata.racing.Add(rec);
                }
                if (attribute == EventAttributeEnum.HBSTAMP)
                {
                    t.last_stamp = rec.hbStamp;
                }
                // notify observers
                if (EntryUpdate != null)
                {
                    foreach (Entry entry in rec.entries)
                    {
                        EntryUpdate(entry);
                    }
                }
            }
        }
예제 #6
0
        private void ComputeEnabledInfo(int exec)  // called under model lock
        {
            // compute info for execution
            int[] tids        = GetThreads(exec).ToArray();
            int   num_entries = GetNumberEntries(exec);

            bool[] enabled = new bool[tids.Length];
            enabled[0] = true;
            int[] enables, disables;
            int   start = GetFirstEntry(exec);
            int   end   = start + num_entries;

            for (int en = start; en < end; en++)
            {
                Entry e = GetEntry(en);
                GetEnableChange(e, out enables, out disables);
                lock (e)
                {
                    e.enableinfo = new EnableInfo[tids.Length];
                    for (int t = 0; t < tids.Length; t++)
                    {
                        e.enableinfo[t] = (enabled[t] ? EnableInfo.Enabled : EnableInfo.Disabled);
                    }
                    if (enables != null)
                    {
                        foreach (int tid in enables)
                        {
                            for (int t = 0; t < tids.Length; t++)
                            {
                                if (tids[t] == tid)
                                {
                                    if (!enabled[t])
                                    {
                                        enabled[t]      = true;
                                        e.enableinfo[t] = EnableInfo.Enable;
                                    }
                                    else
                                    {
                                        e.enableinfo[t] = EnableInfo.Error;
                                        //System.Diagnostics.Debug.Assert(false);
                                    }
                                }
                            }
                        }
                    }
                    if (disables != null)
                    {
                        foreach (int tid in disables)
                        {
                            for (int t = 0; t < tids.Length; t++)
                            {
                                if (tids[t] == tid)
                                {
                                    if (enabled[t])
                                    {
                                        enabled[t]      = false;
                                        e.enableinfo[t] = EnableInfo.Disable;
                                    }
                                    else
                                    {
                                        e.enableinfo[t] = EnableInfo.Error;
                                        //System.Diagnostics.Debug.Assert(false);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }