private void processInstructionFileButton_Click(object sender, EventArgs e) { libraryProcessor = new LibraryResultsProcessor("libraryTrace.txt"); processor = new InstructionProcessor("instructionTrace.txt", libraryProcessor.Libraries, libraryProcessor); librariesBindingSource.DataSource = processor.Libraries.Select(x => x.Name); instructionBindingSource.DataSource = processor.Instructions; threadBindingSource.DataSource = processor.Threads; // remove the data source changed handler briefly, since it slows things down this.resultsGridView.DataSourceChanged -= new System.EventHandler(this.resultsGridView_DataSourceChanged); for (int i = 0; i < processor.Libraries.Count; i++) { loadedLibraryList.SetSelected(i, true); // select all the libraries initially } for (int i = 0; i < processor.Threads.Count; i++) { loadedThreadList.SetSelected(i, true); // select all threads initially } // re add the event handler for data source adds this.resultsGridView.DataSourceChanged += new System.EventHandler(this.resultsGridView_DataSourceChanged); // invoke the data source change handler since we were ignoring it before resultsGridView_DataSourceChanged(null, null); Console.WriteLine("Done processing."); }
private void histogramData_Enter(object sender, EventArgs e) { if (libraryProcessor == null) { libraryProcessor = new LibraryResultsProcessor("memorypin.txt"); } if (processor == null) { processor = new InstructionProcessor("instructionTrace.txt", libraryProcessor.Libraries, libraryProcessor); } IList <Instruction> instrs = processor.Instructions; Dictionary <uint, uint> histogram = new Dictionary <uint, uint>();; // <instruction address, count> foreach (Instruction i in instrs) { if (histogram.ContainsKey(i.Address) == false) { histogram.Add(i.Address, 1); } else { histogram[i.Address]++; } } List <HistogramEntry> convertedHistogram = new List <HistogramEntry>(); foreach (uint key in histogram.Keys) { convertedHistogram.Add(new HistogramEntry(key, histogram[key])); } convertedHistogram.Sort(); convertedHistogram.Reverse(); histogramDataView.DataSource = convertedHistogram; histogramDataView.DefaultCellStyle.Format = "X08"; }
private void histogramData_Enter(object sender, EventArgs e) { if (libraryProcessor == null) libraryProcessor = new LibraryResultsProcessor("memorypin.txt"); if (processor == null) processor = new InstructionProcessor("instructionTrace.txt", libraryProcessor.Libraries, libraryProcessor); IList<Instruction> instrs = processor.Instructions; Dictionary<uint, uint> histogram = new Dictionary<uint, uint>(); ; // <instruction address, count> foreach (Instruction i in instrs) { if (histogram.ContainsKey(i.Address) == false) { histogram.Add(i.Address, 1); } else { histogram[i.Address]++; } } List<HistogramEntry> convertedHistogram = new List<HistogramEntry>(); foreach (uint key in histogram.Keys) { convertedHistogram.Add(new HistogramEntry(key, histogram[key])); } convertedHistogram.Sort(); convertedHistogram.Reverse(); histogramDataView.DataSource = convertedHistogram; histogramDataView.DefaultCellStyle.Format = "X08"; }