agentleFS
MicrosoftKnown publishermicrosoft/perfview/.github/copilot-instructions.md

perfview

Copilot instructions4.8k starsChanged 6 months agoMITView on GitHub

PerfView is a Windows performance-analysis tool for investigating CPU and memory issues, built on the TraceEvent library for parsing ETW and EventPipe trace data. The solution (PerfView.sln) contains the WPF GUI application, the cross-platform TraceEvent library, and several supporting libraries. Follow existing patterns — when in doubt, match the surrounding code.

Trending

Quiet since September.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 1 mentionFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 1 mentionOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/perfview repository that our weekly crawl found: only 13 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about microsoft/perfview

The biggest 5 of 13 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 13

Talked about on GitHub and Hacker News (13 times).

On GitHub · 12

7 more on GitHub

The file

We split this copilot-instructions.md into the rules it gives an agent

7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow existing patterns — when in doubt, match the surrounding code.

    line 36
  2. Very specific:

    All private members go after all public members, wrapped in #region private so Visual Studio outlining (Ctrl-M Ctrl-O) collapses them.

    line 46
  3. Distinctive:

    Use inline comments to explain non-obvious logic and design decisions.

    line 53
  4. Very specific:

    Use Debug.Assert() liberally to validate internal invariants — this is why tests must run in Debug configuration.

    line 56
  5. Very specific:

    Keep changes minimal and focused — complexity is the enemy (see CONTRIBUTING.md).

    line 66
  6. Distinctive:

    Prefer simplicity over cleverness.

    line 67
  7. Distinctive:

    Run tests in Debug configuration before submitting changes.

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

Copilot Instructions for PerfView

Project Overview

PerfView is a Windows performance-analysis tool for investigating CPU and memory issues, built on the TraceEvent library for parsing ETW and EventPipe trace data. The solution (PerfView.sln) contains the WPF GUI application, the cross-platform TraceEvent library, and several supporting libraries.

Architecture

  • src/PerfView/ — WPF GUI application (Windows-only, .NET Framework 4.7.2+, C# 7.3 features only)
  • src/TraceEvent/ — Core trace parsing library (cross-platform, targets netstandard2.0)
  • src/FastSerialization/ — Lightweight binary serialization library
  • src/MemoryGraph/ — Memory dump analysis (graph-based heap representation)
  • src/Utilities/ — Shared utility code
  • src/HeapDump*/ — Heap dump capture using ClrMD (Windows-only native interop)
  • src/EtwClrProfiler/ — Native C++ CLR profiler emitting ETW events (Windows-only)
  • src/PerfViewExtensions/ — Extensibility mechanism ("Global" project)

Build & Test

  • Full solution (Windows): build.cmd or open PerfView.sln in Visual Studio 2026 with the repository .vsconfig components installed. Native ETWClrProfiler projects use the latest installed MSVC v145 toolset.
  • Individual projects (cross-platform via dotnet CLI):
    • dotnet build src/TraceEvent/TraceEvent.csproj -c Debug
    • dotnet build src/FastSerialization/FastSerialization.csproj -c Debug
    • dotnet build src/MemoryGraph/MemoryGraph.csproj -c Debug
  • Running tests: dotnet test <TestProject>.csproj -c Debug — always use Debug configuration so assertions are active.
    • src/TraceEvent/TraceEvent.Tests/TraceEvent.Tests.csproj
    • src/FastSerialization.Tests/FastSerialization.Tests.csproj
    • src/LinuxTracing.Tests/LinuxTracing.Tests.csproj
    • src/PerfView.Tests/PerfView.Tests.csproj (Windows-only)
    • src/SymbolsAuth.Tests/SymbolsAuth.Tests.csproj
  • Tests use xUnit. The full test suite should complete in under 1 minute.
  • NuGet uses central package management (src/Directory.Packages.props). Use the repo-local Nuget.config when restoring: dotnet restore --configfile Nuget.config.

C# Coding Conventions

Follow existing patterns — when in doubt, match the surrounding code.

Naming

  • Standard .NET conventions: PascalCase for types, methods, and properties; camelCase for parameters and locals.
  • Private instance fields: prefix with m_ (e.g., m_nodeCount). The _ prefix is also acceptable.
  • Static fields: prefix with s_ (e.g., s_defaultSize).
  • No Hungarian notation.

Class Layout

  • Order members for readability as a public contract: constructors/factories first, then properties, then methods.
  • All private members go after all public members, wrapped in #region private so Visual Studio outlining (Ctrl-M Ctrl-O) collapses them.
  • Fields go together at the end of the private region — this makes it easy to see all object state at a glance.

Comments & Documentation

  • This codebase is heavily commented — maintain that standard.
  • Public types and public members exposed outside their assembly must have XML doc comments (/// <summary>). Parameter-level docs are optional if names are descriptive.
  • Private fields often need comments, especially to document invariants they maintain.
  • Use inline comments to explain non-obvious logic and design decisions.

Error Handling & Assertions

  • Use Debug.Assert() liberally to validate internal invariants — this is why tests must run in Debug configuration.
  • Throw specific exceptions with descriptive messages for public API misuse.

Other Patterns

  • Type aliases for semantic clarity: using Address = System.UInt64;
  • Lazy initialization for expensive sub-objects (check for null, create on first access).
  • Reuse event objects in TraceEvent callbacks to minimize GC pressure.

Making Changes

  • Keep changes minimal and focused — complexity is the enemy (see CONTRIBUTING.md).
  • Prefer simplicity over cleverness. Performance optimizations that add complexity need measurements to justify them.
  • Run tests in Debug configuration before submitting changes.
  • PerfView embeds its support DLLs into the EXE at build time, creating non-obvious build dependencies. If you see "DLL not found" errors, a normal (non-clean) rebuild usually fixes it.
  • The Global project depends on PerfView — expect unresolved references there until PerfView builds first.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.