mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
c2e9a4acd7
Summary: Add an `eden strace` command that subscribes to all FUSE events for the specified mount (or current directory), and streams them to stdout with response latency measurements and the requesting process. If there are any pending requests at the time `eden strace` is run, they are printed first. Reviewed By: wez Differential Revision: D24038978 fbshipit-source-id: 59a2112dbdb1708571d12b04bdccaf9eca725cf7
72 lines
2.3 KiB
Thrift
72 lines
2.3 KiB
Thrift
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This software may be used and distributed according to the terms of the
|
|
* GNU General Public License version 2.
|
|
*/
|
|
|
|
include "eden/fs/service/eden.thrift"
|
|
namespace cpp2 facebook.eden
|
|
namespace py3 eden.fs.service
|
|
|
|
enum FsEventType {
|
|
UNKNOWN = 0,
|
|
START = 1,
|
|
FINISH = 2,
|
|
}
|
|
|
|
struct FsEvent {
|
|
// Nanoseconds since epoch.
|
|
1: i64 timestamp
|
|
// Nanoseconds since arbitrary clock base, used for computing request
|
|
// durations between start and finish.
|
|
2: i64 monotonic_time_ns
|
|
|
|
3: FsEventType type
|
|
|
|
// See fuseRequest or prjfsRequest for the request opcode name.
|
|
4: string arguments
|
|
|
|
// Always defined on Linux and macOS, but marked optional to support Windows.
|
|
5: eden.FuseCall fuseRequest
|
|
// To add Windows support, mark fuseRequest optional, and add:
|
|
// 6: optional eden.PrjfsCall prjfsRequest
|
|
}
|
|
|
|
/**
|
|
* This Thrift service defines streaming functions. It is separate from
|
|
* EdenService because older Thrift runtimes do not support Thrift streaming,
|
|
* primarily javadeprecated which is used by Buck. When Buck is updated to
|
|
* use java-swift instead, we can merge EdenService and StreamingEdenService.
|
|
*/
|
|
service StreamingEdenService extends eden.EdenService {
|
|
/**
|
|
* Request notification about changes to the journal for
|
|
* the specified mountPoint.
|
|
*
|
|
* IMPORTANT: Do not use the JournalPosition values in the stream. They are
|
|
* meaningless. Instead, call getFilesChangedSince or
|
|
* getCurrentJournalPosition which will return up-to-date information and
|
|
* unblock future notifications on this subscription. If the subscriber
|
|
* never calls getFilesChangedSince or getCurrentJournalPosition in
|
|
* response to a notification on this stream, future notifications may not
|
|
* arrive.
|
|
*
|
|
* This is an implementation of the subscribe API using the
|
|
* new rsocket based streaming thrift protocol.
|
|
* The name is temporary: we want to make some API changes
|
|
* but want to start pushing out an implementation now because
|
|
* we've seen inflated memory usage for the older `subscribe`
|
|
* method above.
|
|
*/
|
|
stream<eden.JournalPosition> subscribeStreamTemporary(
|
|
1: eden.PathString mountPoint
|
|
)
|
|
|
|
/**
|
|
* Returns, in order, a stream of FUSE or PrjFS requests and responses for
|
|
* the given mount.
|
|
*/
|
|
stream<FsEvent> traceFsEvents(1: eden.PathString mountPoint)
|
|
}
|