{"action":"created","issue":{"url":"https://api.github.com/repos/mirage/mirage/issues/460","labels_url":"https://api.github.com/repos/mirage/mirage/issues/460/labels{/name}","comments_url":"https://api.github.com/repos/mirage/mirage/issues/460/comments","events_url":"https://api.github.com/repos/mirage/mirage/issues/460/events","html_url":"https://github.com/mirage/mirage/issues/460","id":115040915,"number":460,"title":"Tracing doesn't work since functoria merge","user":{"login":"talex5","id":554131,"avatar_url":"https://avatars.githubusercontent.com/u/554131?v=3","gravatar_id":"","url":"https://api.github.com/users/talex5","html_url":"https://github.com/talex5","followers_url":"https://api.github.com/users/talex5/followers","following_url":"https://api.github.com/users/talex5/following{/other_user}","gists_url":"https://api.github.com/users/talex5/gists{/gist_id}","starred_url":"https://api.github.com/users/talex5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talex5/subscriptions","organizations_url":"https://api.github.com/users/talex5/orgs","repos_url":"https://api.github.com/users/talex5/repos","events_url":"https://api.github.com/users/talex5/events{/privacy}","received_events_url":"https://api.github.com/users/talex5/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mirage/mirage/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-04T12:21:09Z","updated_at":"2015-11-04T12:31:02Z","closed_at":null,"body":"Test-case (mirage-console + tracing):\r\n\r\n    open Mirage\r\n\r\n    let main =\r\n      foreign \"Unikernel.Main\" (console @-> job)\r\n\r\n    let () =\r\n      let tracing = mprof_trace ~size:1000000 () in\r\n      register \"console\" ~tracing [main $ default_console]\r\n\r\nGives:\r\n\r\n    File \"main.ml\", line 43, characters 2-12:\r\n    Error: This expression has type unit but an expression was expected of type\r\n             'a Lwt.t\r\n\r\nAlso, the code seems to be emitted in the wrong order (tracing should be initialised before everything else, so you can trace the boot sequence and it sees the labels for the initial threads)."},"comment":{"url":"https://api.github.com/repos/mirage/mirage/issues/comments/153706523","html_url":"https://github.com/mirage/mirage/issues/460#issuecomment-153706523","issue_url":"https://api.github.com/repos/mirage/mirage/issues/460","id":153706523,"user":{"login":"talex5","id":554131,"avatar_url":"https://avatars.githubusercontent.com/u/554131?v=3","gravatar_id":"","url":"https://api.github.com/users/talex5","html_url":"https://github.com/talex5","followers_url":"https://api.github.com/users/talex5/followers","following_url":"https://api.github.com/users/talex5/following{/other_user}","gists_url":"https://api.github.com/users/talex5/gists{/gist_id}","starred_url":"https://api.github.com/users/talex5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talex5/subscriptions","organizations_url":"https://api.github.com/users/talex5/orgs","repos_url":"https://api.github.com/users/talex5/repos","events_url":"https://api.github.com/users/talex5/events{/privacy}","received_events_url":"https://api.github.com/users/talex5/received_events","type":"User","site_admin":false},"created_at":"2015-11-04T12:31:02Z","updated_at":"2015-11-04T12:31:02Z","body":"Also, I don't understand the new tracing API:\r\n\r\n    val tracing : int -> job impl\r\n    (** Tracking implementation. *)\r\n\r\n    val mprof_trace : size:int -> unit -> int\r\n    (** Use mirage-profile to trace the unikernel.\r\n        On Unix, this creates and mmaps a file called \"trace.ctf\".\r\n        On Xen, it shares the trace buffer with dom0.\r\n\r\n        Deprecated. Is the identity over size.\r\n    *)\r\n\r\n    val register :\r\n      ?tracing:int ->\r\n      ?keys:Key.t list ->\r\n      ?libraries:string list ->\r\n      ?packages:string list -> string -> job impl list -> unit\r\n    (** [register name jobs] registers the application named by [name]\r\n        which will executes the given [jobs].\r\n        @param libraries The ocamlfind libraries needed by this module.\r\n        @param packages The opam packages needed by this module.\r\n        @param keys The keys related to this module.\r\n\r\n        @param tracing Enable tracing and give a default depth.\r\n    *)\r\n\r\nWhy is `mprof_trace` deprecated? Are we sure we'll never want a different tracing framework, or new parameters for the existing one?\r\n\r\nWhy is the ring buffer size now called `depth`? (and `Mirage_key` now refers to it as the `tracing level`)"}}