Lines Matching full:sink
9 * Usage: debug-trigger [SOURCE] [SINK]
12 * --sink-actions=ACTION
13 * Set the class of sink action(s) to be used. Can take the value of 'sysrq' or 'dbus'.
18 * Set the source as stdin, the sink as stdout, and use the default 'sysrq' set of sink
21 * debug-trigger --sink-actions=sysrq
22 * Explicitly use the 'sysrq' set of sink actions with stdin as the source and stdout as the
23 * sink.
26 * Open /dev/serio_raw0 as the source and /proc/sysrq-trigger as the sink, with the default
27 * 'sysrq' set of sink actions. When 'D' is read from /dev/serio_raw0 'c' will be written to
31 * dbug-trigger --sink-actions=dbus /dev/serio_raw0
32 * Open /dev/serio_raw0 as the source and configure the 'dbus' set of sink actions. When 'D' is
92 int sink; member
108 if ((rc = write(sysrq->sink, &action, sizeof(action))) == sizeof(action)) in sysrq_sink_debug()
127 if ((rc = write(sysrq->sink, &action, sizeof(action))) == sizeof(action)) in sysrq_sink_reboot()
466 static int process(struct debug_source *source, struct debug_sink *sink) in process() argument
475 sink->ops->debug(sink->ctx); in process()
479 sink->ops->reboot(sink->ctx); in process()
500 struct debug_sink sink; in main() local
509 {"sink-actions", required_argument, 0, 's'}, in main()
528 * The default behaviour sets the source file descriptor as stdin and the sink file in main()
559 * Handle the sink path argument, if any. If sink_actions hasn't been set via the in main()
560 * --sink-actions option, then default to 'sysrq'. Otherwise, if --sink-actions=sysrq has in main()
561 * been passed, do as we're told and use the 'sysrq' sink actions. in main()
566 * Just open the sink path directly. If we ever need different behaviour in main()
570 err(EXIT_FAILURE, "Failed to open sink %s", argv[optind]); in main()
579 sysrq_sink.sink = sinkfd; in main()
580 sink.ops = &sysrq_sink_ops; in main()
581 sink.ctx = &sysrq_sink; in main()
584 /* Set up the dbus sink actions if requested via --sink-actions=dbus */ in main()
602 sink.ops = &dbus_sink_ops; in main()
603 sink.ctx = &dbus_sink; in main()
613 if (!(sink.ops && sink.ctx)) in main()
614 errx(EXIT_FAILURE, "Unrecognised sink: %s", sink_actions); in main()
616 /* Trigger the actions on the sink when we receive an event from the source */ in main()
617 if (process(&source, &sink) < 0) in main()