Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@vyazelenko
Copy link
Contributor

@vyazelenko vyazelenko commented Nov 21, 2020

Changes in this PR:

  • Align event initialization between C and Java code, i.e. add support using special words like all, admin as well as event names or numerical codes.

    For example using the following comma-separated list of events
    CMD_IN_REMOVE_COUNTER,33,NAME_RESOLUTION_NEIGHBOR_ADDED,CMD_OUT_ERROR,FRAME_OUT to set AERON_EVENT_LOG or aeron.event.log property will enable CMD_IN_REMOVE_COUNTER, CMD_OUT_EXCLUSIVE_PUBLICATION_READY, FRAME_OUT, NAME_RESOLUTION_NEIGHBOR_ADDED and CMD_OUT_ERROR events.

  • Support legacy mask-based logging event initialization for the C driver, i.e.:

    • 0xffff - the same as all (enables all events).
    • 0x1 - enables all CMD_IN events (e.g. CMD_IN_ADD_PUBLICATION, CMD_IN_REMOVE_SUBSCRIPTION etc.).
    • 0x2 - enables all CMD_OUT events (e.g. CMD_OUT_PUBLICATION_READY, CMD_OUT_ERROR etc.).
    • 0x4 - enables FRAME_IN event.
    • 0x8, 0x10 - enables FRAME_OUT event.
    • 0x80 - enables UNTETHERED_SUBSCRIPTION_STATE_CHANGE event.
    • The combined masks from the above values can be used to enable multiple events, e.g. 0x8F enables FRAME_IN, FRAME_OUT and UNTETHERED_SUBSCRIPTION_STATE_CHANGE events.
  • Enable individual logging of the CMD_IN/CMD_OUT events in the C driver. Despite using a single hook for the in/out events the logging is only done if a particular event is enabled, i.e. a runtime O(1) check if performed and if it fails logging call is a no op.

  • Add logging for the name resolution neighbor added/removed to the Java driver.

  • Add logging for the IpcPublication cleanup to the Java driver.

  • Add all missing events to the C driver, i.e.:

    • REMOVE_PUBLICATION_CLEANUP
    • REMOVE_SUBSCRIPTION_CLEANUP
    • REMOVE_IMAGE_CLEANUP
    • SEND_CHANNEL_CREATION
    • RECEIVE_CHANNEL_CREATION
    • SEND_CHANNEL_CLOSE
    • RECEIVE_CHANNEL_CLOSE
    • NAME_RESOLUTION_NEIGHBOR_ADDED
    • NAME_RESOLUTION_NEIGHBOR_REMOVED
  • Format logging header the same way as in Java and use nano clock in the C driver.

  • Remove obsolete events from the C driver agent:

    • AERON_RAW_LOG_MAP_OP (0x20)
    • AERON_RAW_LOG_CLOSE_OP (0x40)
    • AERON_DYNAMIC_DISSECTOR_EVENT (0x100)
    • AERON_RAW_LOG_FREE_OP (0x200)

Fixes #1072

…e event log string using the same names and/or values.
…mage_entry_delete to aeron_receive_channel_endpoint_entry_delete, because it is where endpoint is disconnected thus loosing channel URI info.
…ommands and pass channel_length before channel.
@mjpt777
Copy link
Contributor

mjpt777 commented Nov 25, 2020

In general, looks good.

@vyazelenko
Copy link
Contributor Author

@mjpt777 All found issues were fixed.

# Conflicts:
#	aeron-driver/src/main/c/agent/aeron_driver_agent.c
#	aeron-driver/src/test/c/agent/aeron_driver_agent_test.cpp
@mjpt777 mjpt777 merged commit 6cfdad9 into aeron-io:master Nov 26, 2020
@vyazelenko vyazelenko deleted the issue_1072 branch November 27, 2020 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align agent logging between Java and C drivers

2 participants