added Perf bin
This commit is contained in:
parent
d0c01800a6
commit
13fe7fbab1
38
src/bin/Perf.hx
Normal file
38
src/bin/Perf.hx
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
package bin;
|
||||||
|
|
||||||
|
import kernel.peripherals.Peripherals.Peripheral;
|
||||||
|
import lib.CLIAppBase;
|
||||||
|
|
||||||
|
class Perf extends CLIAppBase {
|
||||||
|
public function new() {
|
||||||
|
registerSyncSubcommand("inspect",(args)->{
|
||||||
|
if (args.length < 1) return false;
|
||||||
|
|
||||||
|
var result = Peripheral.instance.inspect(args[0]);
|
||||||
|
|
||||||
|
if (result == null){
|
||||||
|
handle.writeLine("No peripheral found on side "+args[0]);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
handle.writeLine("Types:");
|
||||||
|
for (type in result.types){
|
||||||
|
handle.writeLine(" "+type);
|
||||||
|
}
|
||||||
|
|
||||||
|
handle.writeLine("Methods:");
|
||||||
|
for (method in result.methods){
|
||||||
|
handle.writeLine(" "+method);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
},"<side>");
|
||||||
|
|
||||||
|
registerSyncSubcommand("list",(args)->{
|
||||||
|
for (addr in Peripheral.instance.getAllAddresses()){
|
||||||
|
handle.writeLine('$addr => ${Peripheral.instance.getTypes(addr).join(", ")}');
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -18,6 +18,7 @@ class DCEHack {
|
|||||||
new bin.HelloWorldService(),
|
new bin.HelloWorldService(),
|
||||||
new bin.srsc.SiteRessourceController(),
|
new bin.srsc.SiteRessourceController(),
|
||||||
new bin.srsc.CLI(),
|
new bin.srsc.CLI(),
|
||||||
|
new bin.Perf(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package kernel.binstore;
|
package kernel.binstore;
|
||||||
|
|
||||||
|
import bin.Perf;
|
||||||
import bin.srsc.CLI;
|
import bin.srsc.CLI;
|
||||||
import bin.srsc.SiteRessourceController;
|
import bin.srsc.SiteRessourceController;
|
||||||
import bin.HelloWorldService;
|
import bin.HelloWorldService;
|
||||||
@ -31,7 +32,8 @@ class BinStore {
|
|||||||
{c: Service, name: "Service", aliases: ["service","srv"]},
|
{c: Service, name: "Service", aliases: ["service","srv"]},
|
||||||
{c: HelloWorldService, name: "HelloWorldService", aliases: ["hello-service"] },
|
{c: HelloWorldService, name: "HelloWorldService", aliases: ["hello-service"] },
|
||||||
{c: SiteRessourceController, name: "SiteRessourceController", aliases: ["srsc"]},
|
{c: SiteRessourceController, name: "SiteRessourceController", aliases: ["srsc"]},
|
||||||
{c: CLI, name: "SRSC CLI", aliases: ["srsc-cli"]}
|
{c: CLI, name: "SRSC CLI", aliases: ["srsc-cli"]},
|
||||||
|
{c: Perf, name: "Perf", aliases: ["perf"]}
|
||||||
];
|
];
|
||||||
|
|
||||||
@:allow(kernel.Init)
|
@:allow(kernel.Init)
|
||||||
|
Loading…
Reference in New Issue
Block a user