singrdk/base/Contracts/Diagnostics.Contracts/ProcessContract.sg

66 lines
2.3 KiB
Plaintext
Raw Normal View History

2008-03-05 09:52:00 -05:00
///////////////////////////////////////////////////////////////////////////////
//
// Microsoft Research Singularity
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Note: Contract definition for the process diagnostic module
//
using Microsoft.Singularity.Directory;
using Microsoft.Singularity.Channels;
namespace Microsoft.Singularity.Diagnostics.Contracts
{
public contract ProcessContract : ServiceContract
{
// The name you should use to look up this module using the NameServer.
2008-11-17 18:29:00 -05:00
public const string ModuleName = "/status/process";
2008-03-05 09:52:00 -05:00
// Signal our identity
out message Ready();
// Retrieve the list of processes
in message GetProcessIDs();
out message ProcessIDs(int[]! in ExHeap IDs);
// Retrieve a process name
in message GetProcessName(int procID);
out message ProcessName(char[]! in ExHeap procName);
2008-11-17 18:29:00 -05:00
// Retrieve the threadID set for a given a process
2008-03-05 09:52:00 -05:00
in message GetProcessThreadIDs(int procID);
out message ProcessThreadIDs(int[]! in ExHeap tids);
2008-11-17 18:29:00 -05:00
// Retrieve the process times for a given process
2008-03-05 09:52:00 -05:00
in message GetProcessTimes(int procID);
out message ProcessTimes(long totalTime, long deadThreadTime, long deadThreadCount);
2008-11-17 18:29:00 -05:00
// Retrieve the stats for a given Process
2008-03-05 09:52:00 -05:00
in message GetProcessGcStats(int procID);
out message ProcessGcStats(int count, long time, long bytes);
2008-11-17 18:29:00 -05:00
// Retrieve the ID of the process's parent
in message GetParentID(int procID);
out message ParentID(int parentID);
2008-03-05 09:52:00 -05:00
// Process not found
out message NotFound();
override state Start : one
{
Ready! -> ReadyState;
}
state ReadyState : one
{
GetProcessIDs? -> ProcessIDs! -> ReadyState;
GetProcessThreadIDs? -> (ProcessThreadIDs! or NotFound!) -> ReadyState;
GetProcessTimes? -> (ProcessTimes! or NotFound!) -> ReadyState;
GetProcessGcStats? -> (ProcessGcStats! or NotFound!) -> ReadyState;
GetProcessName? -> (ProcessName! or NotFound!) -> ReadyState;
2008-11-17 18:29:00 -05:00
GetParentID? -> (ParentID! or NotFound!) -> ReadyState;
2008-03-05 09:52:00 -05:00
}
}
}