ls-monitor

Version added 2017-10-26 21:13:00| Modified 12-Apr-2018

ls-monitor is a command-line tool accessible through a shell on a device. ls-monitor lets you see traffic going over the webOS service bus, similar to a network sniffer that lets you observe HTTP traffic.

SYNTAX

ls-monitor [OPTIONS...]

Pressing the [CTRL + C] key breaks out of the monitoring.

OPTIONS

Option Parameter Description

-h, --help

None

Displays the help.

-f, --filter

SERVICE_NAME

Filters by service name (or unique name).

e.g. -f com.webos.foo or --filter=com.webos.foo

-l, --list

None

Lists all luna services connected to a hub.

-s, --subscriptions

None

Lists all subscriptions in the system.

-i, --introspection

SERVICE_NAME

Lists service methods and signals.

e.g. -i com.webos.foo or --introspection=com.webos.foo

-v, --api-version

SERVICE_NAME

Displays the version of the service.

e.g. -v com.webos.foo or --api-version=com.webos.foo

-m, --malloc

None

Lists memory allocation data from all services in the system.

-d, --debug

None

Prints extra output for debugging monitor.

Be careful of unbounded memory growth when using the debug option.

-c, --compact

None

Prints compact output to fit terminal. The followings indicate the symbols in the message printed in the Console.

  • >* : Signal

  • >| : Cancel method call

  • > : Method call

  • < : Reply

e.g. TX c.w.s.activemanage >| TX c.w.s.activemanage/private/cancel

This option takes precedence over the debug option.

-j, --json

None

Prints JSON-formatted output for easy parsing.

This option takes precedence over the debug option.

-t, --sort-by-timestamps

None

Sorts output by timestamp instead of serial.

--dump-hub-data-csv

None

Dumps hub data in CSV format.

PARAMETERS

Parameter Description

SERVICE_NAME

Specifies the name of the service.

EXAMPLES

List all the luna services.

ls-monitor -l

HUB CLIENTS:
PID SERVICE NAME EXE TYPE UNIQUE NAME
313 com.webos.service.config /usr/sbin/configd static ZIHgbWv9
801 com.webos.service.networkinput /usr/sbin/network-input-service static L7YwNnur
337 com.webos.surfacemanager.quicksettings /usr/bin/surface-manager -starfish unknown/client only KHXoJxmm
337 com.webos.launcher /usr/bin/surface-manager-starfis h unknown/client only uBGh5df5
363 com.webos.service.audio /usr/sbin/audiod static 6jpvQyHO
404 com.webos.service.pan /usr/sbin/webos-connman-adapter static 7drAG6IN
404 com.webos.service.wan /usr/sbin/webos-connman-adapter static evNNL6pt

List the luna services and searches for the services including 'settings' in the results.

ls-monitor -l | grep 'settings'

List the luna services and searches for the services including 'com.webos.service' in the results.

ls-monitor -l | grep 'com.webos.service*'

Request the version of the service name 'com.webos.service.settings'.

ls-monitor -v com.webos.service.settings

com.webos.service.settings 1.0

List all service methods and signals registered by 'com.webos.service.settings'.

ls-monitor -i com.webos.service.settings

METHODS AND SIGNALS REGISTERED BY SERVICE 'com.webos.service.settings' WITH UNIQUE NAME 'kX72BmbF' AT HUB
"/":
"getCurrentSettings": {"provides"["all","private","settings.read","settings"]}
"resetSystemSettingDesc": {"provides":["all","private","settings"]}
"getSystemSettings": {"provides":["all","private","settings.read","settings","public"]}
"setSystemSettingDesc": {"provides":["all","private","settings"]}
"setSystemSettingFactoryValue": {"provides":["all","private","settings"]}
"setSystemSettingFactoryDesc": {"provides":["all","private","settings"]}
"deleteSystemSettings": {"provides":["all","private","settings"]}
"batch": {"provides":["all","private","settings"]}
"getSystemSettingValues": {"provides":["all","private","settings.read","settings","public"]}
"setSystemSettingValues": {"provides":["all","private","settings"]}
"getSystemSettingFactoryValue": {"provides":["all","private","settings.read","settings","public"]}
"setSystemSettings": {"provides":["all","private","settings","public"]}
"getSystemSettingDesc": {"provides":["all","private","settings.read","settings"]}
"resetSystemSettings": {"provides":["all","private","settings"]}
"/internal":
"getCurrentSubscriptions": {"provides":["all","private","settings"]}
"instrument": {"provides":["all","private","settings"]}

Filter by service name 'com.webos.service' and searches for the logs including 'com.webos.service.setting' in the results without case-sensitivity restrictions. 

ls-monitor --filter=com.webos.service | grep -i 'com.webos.service.setting*'

 

Except as noted, this content is licensed under Creative Commons Attribution 4.0 and sample code is licensed under Apache License 2.0.