Skip to content

Commit

Permalink
Fix flowstorm.startRecording for AOT
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmonettas committed Sep 27, 2023
1 parent 8ce51a9 commit 3c255d3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
5 changes: 2 additions & 3 deletions src-dbg/flow_storm/debugger/ui/timeline/screen.clj
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
(def thread-colors ["#DAE8FC" "#D5E8D4" "#FFE6CC" "#F8CECC" "#E1D5E7" "#60A917" "#4C0099" "#CC00CC"])

(defn set-recording-check [recording?]
(ui-utils/run-later
(let [[record-btn] (obj-lookup "total-order-record-btn")]
(.setSelected record-btn recording?))))
(let [[record-btn] (obj-lookup "total-order-record-btn")]
(.setSelected record-btn recording?)))

(defn clear-timeline []
(let [[{:keys [clear]}] (obj-lookup "total-order-table-data")]
Expand Down
3 changes: 3 additions & 0 deletions src-inst/flow_storm/api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@
theme-prop (assoc :theme (keyword theme-prop))
styles-prop (assoc :styles styles-prop)
title-prop (assoc :title title-prop))]

(tracer/set-recording (if (= (System/getProperty "flowstorm.startRecording") "false") false true))

config))

(defn- start-runtime [{:keys [skip-index-start? skip-debugger-start? events-dispatch-fn] :as config}]
Expand Down
6 changes: 4 additions & 2 deletions src-inst/flow_storm/api.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
[flow-storm.runtime.indexes.api :as indexes-api]
[flow-storm.runtime.debuggers-api :as dbg-api]
[flow-storm.runtime.values :as rt-values]
[flow-storm.utils :refer [log] :as utils]
[flow-storm.tracer]
[flow-storm.utils :refer [log] :as utils :refer-macros [env-prop]]
[flow-storm.tracer :as tracer]
[hansel.instrument.runtime])
(:require-macros [flow-storm.api]))

Expand All @@ -24,6 +24,8 @@

(indexes-api/start)

(tracer/set-recording (if (= (env-prop "flowstorm.startRecording") "false") false true))

;; connect to the remote websocket
(remote-websocket-client/start-remote-websocket-client
(assoc config
Expand Down
3 changes: 1 addition & 2 deletions src-inst/flow_storm/storm_api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
(:require [flow-storm.api :as fs-api]
[flow-storm.tracer :as tracer]
[flow-storm.runtime.debuggers-api :as debuggers-api]
[flow-storm.runtime.indexes.api :as indexes-api]
[flow-storm.runtime.indexes.timeline-index :as timeline-index]))
[flow-storm.runtime.indexes.api :as indexes-api]))

(defn start-recorder []
(fs-api/setup-runtime)
Expand Down
5 changes: 2 additions & 3 deletions src-inst/flow_storm/tracer.cljc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(ns flow-storm.tracer
(:require #?(:clj [flow-storm.utils :as utils :refer [env-prop]]
:cljs [flow-storm.utils :as utils :refer-macros [env-prop]] )
(:require [flow-storm.utils :as utils]
[hansel.instrument.runtime :refer [*runtime-ctx*]]
[flow-storm.runtime.values :refer [snapshot-reference]]
[flow-storm.runtime.indexes.api :as indexes-api]
Expand All @@ -14,7 +13,7 @@
(declare stop-tracer)

(def total-order-recording (atom false))
(def recording (atom (if (= (env-prop "flowstorm.startRecording") "false") false true)))
(def recording (atom true))
(def breakpoints (atom #{}))
(def blocked-threads (atom #{}))

Expand Down

0 comments on commit 3c255d3

Please sign in to comment.