コード例 #1
0
        private void PopulateSymbolMapperAndGuids(ZipArchive archive)
        {
            Contract.Requires(archive != null, nameof(archive));

            foreach (var entry in archive.Entries)
            {
                if (MapFilePatterns.IsMatch(entry.FullName))
                {
                    Mapper mapper = new Mapper();
                    this.fileSymbolMappers[LinuxPerfScriptEventParser.GetFileNameWithoutExtension(entry.FullName)] = mapper;
                    using (Stream stream = entry.Open())
                    {
                        this.parser.ParseSymbolFile(stream, mapper);
                    }
                    mapper.DoneMapping();
                }
                else if (PerfInfoPattern.IsMatch(LinuxPerfScriptEventParser.GetFileName(entry.FullName)))
                {
                    Dictionary <string, string> guids = new Dictionary <string, string>();
                    this.processDllGuids[LinuxPerfScriptEventParser.GetFileName(entry.FullName)] = guids;
                    using (Stream stream = entry.Open())
                    {
                        this.parser.ParsePerfInfoFile(stream, guids);
                    }
                }
            }
        }
コード例 #2
0
        private void PopulateSymbolMapperAndGuids(ZipArchive archive)
        {
            Contract.Requires(archive != null, nameof(archive));

            foreach (var entry in archive.Entries)
            {
                if (MapFilePatterns.IsMatch(entry.FullName))
                {
                    Mapper mapper = new Mapper();

                    // Register the mapper both with and without the .ni extension.
                    // Old versions of the runtime contain native images with the .ni extension.
                    fileSymbolMappers[LinuxPerfScriptEventParser.GetFileNameWithoutExtension(entry.FullName, false)] = mapper;
                    fileSymbolMappers[LinuxPerfScriptEventParser.GetFileNameWithoutExtension(entry.FullName, true)]  = mapper;
                    using (Stream stream = entry.Open())
                    {
                        parser.ParseSymbolFile(stream, mapper);
                    }
                    mapper.DoneMapping();
                }
                else if (PerfInfoPattern.IsMatch(LinuxPerfScriptEventParser.GetFileName(entry.FullName)))
                {
                    Dictionary <string, string> guids = new Dictionary <string, string>();
                    processDllGuids[LinuxPerfScriptEventParser.GetFileName(entry.FullName)] = guids;
                    using (Stream stream = entry.Open())
                    {
                        parser.ParsePerfInfoFile(stream, guids);
                    }
                }
            }
        }
コード例 #3
0
        public LinuxPerfScriptMapper(ZipArchive archive, LinuxPerfScriptEventParser parser)
        {
            this.fileSymbolMappers = new Dictionary <string, Mapper>();
            this.processDllGuids   = new Dictionary <string, Dictionary <string, string> >();
            this.parser            = parser;

            if (archive != null)
            {
                this.PopulateSymbolMapperAndGuids(archive);
            }
        }
コード例 #4
0
        public LinuxPerfScriptStackSource(string path, bool doThreadTime)
        {
            this.doThreadTime = doThreadTime;
            currentStackIndex = 0;

            ZipArchive archive;

            using (Stream stream = GetPerfScriptStream(path, out archive))
            {
                masterSource = new FastStream(stream, BufferSize);
                parser       = new LinuxPerfScriptEventParser();
                parser.SetSymbolFile(archive);

                InternAllLinuxEvents(stream);
                stream.Close();
            }
            archive?.Dispose();
        }