get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/45425/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 45425,
    "url": "http://patches.dpdk.org/api/patches/45425/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180926163727.47337-6-david.hunt@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20180926163727.47337-6-david.hunt@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180926163727.47337-6-david.hunt@intel.com",
    "date": "2018-09-26T16:37:22",
    "name": "[v5,05/10] examples/power: add host channel to power manager",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "996cde9ffc5df61f4c7332ed60d6345c69c7c8f2",
    "submitter": {
        "id": 342,
        "url": "http://patches.dpdk.org/api/people/342/?format=api",
        "name": "Hunt, David",
        "email": "david.hunt@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20180926163727.47337-6-david.hunt@intel.com/mbox/",
    "series": [
        {
            "id": 1524,
            "url": "http://patches.dpdk.org/api/series/1524/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1524",
            "date": "2018-09-26T16:37:19",
            "name": "add json power policy interface for containers",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/1524/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/45425/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/45425/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 01E611B450;\n\tWed, 26 Sep 2018 18:42:12 +0200 (CEST)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id 4DA261B143\n\tfor <dev@dpdk.org>; Wed, 26 Sep 2018 18:42:01 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t26 Sep 2018 09:41:58 -0700",
            "from silpixa00399952.ir.intel.com (HELO\n\tsilpixa00399952.ger.corp.intel.com) ([10.237.223.64])\n\tby fmsmga006.fm.intel.com with ESMTP; 26 Sep 2018 09:37:36 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.54,306,1534834800\"; d=\"scan'208\";a=\"266907080\"",
        "From": "David Hunt <david.hunt@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "john.mcnamara@intel.com, stephen@networkplumber.org, lei.a.yao@intel.com,\n\tanatoly.burakov@intel.com, David Hunt <david.hunt@intel.com>",
        "Date": "Wed, 26 Sep 2018 17:37:22 +0100",
        "Message-Id": "<20180926163727.47337-6-david.hunt@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20180926163727.47337-1-david.hunt@intel.com>",
        "References": "<20180926134037.43606-1-david.hunt@intel.com>\n\t<20180926163727.47337-1-david.hunt@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v5 05/10] examples/power: add host channel to\n\tpower manager",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This patch adds a fifo channel to the vm_power_manager app through which\nwe can send commands and polices. Intended for sending JSON strings.\nThe fifo is at /tmp/powermonitor/fifo\n\nSigned-off-by: David Hunt <david.hunt@intel.com>\nAcked-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n examples/vm_power_manager/channel_manager.c | 109 +++++++++++++++\n examples/vm_power_manager/channel_manager.h |  17 +++\n examples/vm_power_manager/channel_monitor.c | 142 +++++++++++++++-----\n examples/vm_power_manager/main.c            |   2 +\n 4 files changed, 236 insertions(+), 34 deletions(-)",
    "diff": "diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c\nindex 2e471d0c1..4fac099df 100644\n--- a/examples/vm_power_manager/channel_manager.c\n+++ b/examples/vm_power_manager/channel_manager.c\n@@ -13,6 +13,7 @@\n \n #include <sys/queue.h>\n #include <sys/types.h>\n+#include <sys/stat.h>\n #include <sys/socket.h>\n #include <sys/select.h>\n \n@@ -284,6 +285,38 @@ open_non_blocking_channel(struct channel_info *info)\n \treturn 0;\n }\n \n+static int\n+open_host_channel(struct channel_info *info)\n+{\n+\tint flags;\n+\n+\tinfo->fd = open(info->channel_path, O_RDWR | O_RSYNC);\n+\tif (info->fd == -1) {\n+\t\tRTE_LOG(ERR, CHANNEL_MANAGER, \"Error(%s) opening fifo for '%s'\\n\",\n+\t\t\t\tstrerror(errno),\n+\t\t\t\tinfo->channel_path);\n+\t\treturn -1;\n+\t}\n+\n+\t/* Get current flags */\n+\tflags = fcntl(info->fd, F_GETFL, 0);\n+\tif (flags < 0) {\n+\t\tRTE_LOG(WARNING, CHANNEL_MANAGER, \"Error(%s) fcntl get flags socket for\"\n+\t\t\t\t\"'%s'\\n\", strerror(errno), info->channel_path);\n+\t\treturn 1;\n+\t}\n+\t/* Set to Non Blocking */\n+\tflags |= O_NONBLOCK;\n+\tif (fcntl(info->fd, F_SETFL, flags) < 0) {\n+\t\tRTE_LOG(WARNING, CHANNEL_MANAGER,\n+\t\t\t\t\"Error(%s) setting non-blocking \"\n+\t\t\t\t\"socket for '%s'\\n\",\n+\t\t\t\tstrerror(errno), info->channel_path);\n+\t\treturn -1;\n+\t}\n+\treturn 0;\n+}\n+\n static int\n setup_channel_info(struct virtual_machine_info **vm_info_dptr,\n \t\tstruct channel_info **chan_info_dptr, unsigned channel_num)\n@@ -294,6 +327,7 @@ setup_channel_info(struct virtual_machine_info **vm_info_dptr,\n \tchan_info->channel_num = channel_num;\n \tchan_info->priv_info = (void *)vm_info;\n \tchan_info->status = CHANNEL_MGR_CHANNEL_DISCONNECTED;\n+\tchan_info->type = CHANNEL_TYPE_BINARY;\n \tif (open_non_blocking_channel(chan_info) < 0) {\n \t\tRTE_LOG(ERR, CHANNEL_MANAGER, \"Could not open channel: \"\n \t\t\t\t\"'%s' for VM '%s'\\n\",\n@@ -316,6 +350,42 @@ setup_channel_info(struct virtual_machine_info **vm_info_dptr,\n \treturn 0;\n }\n \n+static void\n+fifo_path(char *dst, unsigned int len)\n+{\n+\tsnprintf(dst, len, \"%sfifo\", CHANNEL_MGR_SOCKET_PATH);\n+}\n+\n+static int\n+setup_host_channel_info(struct channel_info **chan_info_dptr,\n+\t\tunsigned int channel_num)\n+{\n+\tstruct channel_info *chan_info = *chan_info_dptr;\n+\n+\tchan_info->channel_num = channel_num;\n+\tchan_info->priv_info = (void *)NULL;\n+\tchan_info->status = CHANNEL_MGR_CHANNEL_DISCONNECTED;\n+\tchan_info->type = CHANNEL_TYPE_JSON;\n+\n+\tfifo_path(chan_info->channel_path, sizeof(chan_info->channel_path));\n+\n+\tif (open_host_channel(chan_info) < 0) {\n+\t\tRTE_LOG(ERR, CHANNEL_MANAGER, \"Could not open host channel: \"\n+\t\t\t\t\"'%s'\\n\",\n+\t\t\t\tchan_info->channel_path);\n+\t\treturn -1;\n+\t}\n+\tif (add_channel_to_monitor(&chan_info) < 0) {\n+\t\tRTE_LOG(ERR, CHANNEL_MANAGER, \"Could add channel: \"\n+\t\t\t\t\"'%s' to epoll ctl\\n\",\n+\t\t\t\tchan_info->channel_path);\n+\t\treturn -1;\n+\n+\t}\n+\tchan_info->status = CHANNEL_MGR_CHANNEL_CONNECTED;\n+\treturn 0;\n+}\n+\n int\n add_all_channels(const char *vm_name)\n {\n@@ -470,6 +540,45 @@ add_channels(const char *vm_name, unsigned *channel_list,\n \treturn num_channels_enabled;\n }\n \n+int\n+add_host_channel(void)\n+{\n+\tstruct channel_info *chan_info;\n+\tchar socket_path[PATH_MAX];\n+\tint num_channels_enabled = 0;\n+\tint ret;\n+\n+\tfifo_path(socket_path, sizeof(socket_path));\n+\n+\tret = mkfifo(socket_path, 0660);\n+\tif ((errno != EEXIST) && (ret < 0)) {\n+\t\tRTE_LOG(ERR, CHANNEL_MANAGER, \"Cannot create fifo '%s' error: \"\n+\t\t\t\t\"%s\\n\", socket_path, strerror(errno));\n+\t\treturn 0;\n+\t}\n+\n+\tif (access(socket_path, F_OK) < 0) {\n+\t\tRTE_LOG(ERR, CHANNEL_MANAGER, \"Channel path '%s' error: \"\n+\t\t\t\t\"%s\\n\", socket_path, strerror(errno));\n+\t\treturn 0;\n+\t}\n+\tchan_info = rte_malloc(NULL, sizeof(*chan_info), 0);\n+\tif (chan_info == NULL) {\n+\t\tRTE_LOG(ERR, CHANNEL_MANAGER, \"Error allocating memory for \"\n+\t\t\t\t\"channel '%s'\\n\", socket_path);\n+\t\treturn 0;\n+\t}\n+\tsnprintf(chan_info->channel_path,\n+\t\t\tsizeof(chan_info->channel_path), \"%s\", socket_path);\n+\tif (setup_host_channel_info(&chan_info, 0) < 0) {\n+\t\trte_free(chan_info);\n+\t\treturn 0;\n+\t}\n+\tnum_channels_enabled++;\n+\n+\treturn num_channels_enabled;\n+}\n+\n int\n remove_channel(struct channel_info **chan_info_dptr)\n {\ndiff --git a/examples/vm_power_manager/channel_manager.h b/examples/vm_power_manager/channel_manager.h\nindex 872ec6140..e32235b07 100644\n--- a/examples/vm_power_manager/channel_manager.h\n+++ b/examples/vm_power_manager/channel_manager.h\n@@ -54,6 +54,13 @@ enum channel_status { CHANNEL_MGR_CHANNEL_DISCONNECTED = 0,\n \tCHANNEL_MGR_CHANNEL_DISABLED,\n \tCHANNEL_MGR_CHANNEL_PROCESSING};\n \n+/* Communication Channel Type */\n+enum channel_type {\n+\tCHANNEL_TYPE_BINARY = 0,\n+\tCHANNEL_TYPE_INI,\n+\tCHANNEL_TYPE_JSON\n+};\n+\n /* VM libvirt(qemu/KVM) connection status */\n enum vm_status { CHANNEL_MGR_VM_INACTIVE = 0, CHANNEL_MGR_VM_ACTIVE};\n \n@@ -66,6 +73,7 @@ struct channel_info {\n \tvolatile uint32_t status;    /**< Connection status(enum channel_status) */\n \tint fd;                      /**< AF_UNIX socket fd */\n \tunsigned channel_num;        /**< CHANNEL_MGR_SOCKET_PATH/<vm_name>.channel_num */\n+\tenum channel_type type;      /**< Binary, ini, json, etc. */\n \tvoid *priv_info;             /**< Pointer to private info, do not modify */\n };\n \n@@ -226,6 +234,15 @@ int add_all_channels(const char *vm_name);\n int add_channels(const char *vm_name, unsigned *channel_list,\n \t\tunsigned num_channels);\n \n+/**\n+ * Set up a fifo by which host applications can send command an policies\n+ * through a fifo to the vm_power_manager\n+ *\n+ * @return\n+ *  - 0 for success\n+ */\n+int add_host_channel(void);\n+\n /**\n  * Remove a channel definition from the channel manager. This must only be\n  * called from the channel monitor thread.\ndiff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c\nindex f180d74e6..c3c3d7bb1 100644\n--- a/examples/vm_power_manager/channel_monitor.c\n+++ b/examples/vm_power_manager/channel_monitor.c\n@@ -85,6 +85,33 @@ core_share_status(int pNo)\n \t}\n }\n \n+\n+static int\n+pcpu_monitor(struct policy *pol, struct core_info *ci, int pcpu, int count)\n+{\n+\tint ret = 0;\n+\n+\tif (pol->pkt.policy_to_use == BRANCH_RATIO) {\n+\t\tci->cd[pcpu].oob_enabled = 1;\n+\t\tret = add_core_to_monitor(pcpu);\n+\t\tif (ret == 0)\n+\t\t\tRTE_LOG(INFO, CHANNEL_MONITOR,\n+\t\t\t\t\t\"Monitoring pcpu %d OOB for %s\\n\",\n+\t\t\t\t\tpcpu, pol->pkt.vm_name);\n+\t\telse\n+\t\t\tRTE_LOG(ERR, CHANNEL_MONITOR,\n+\t\t\t\t\t\"Error monitoring pcpu %d OOB for %s\\n\",\n+\t\t\t\t\tpcpu, pol->pkt.vm_name);\n+\n+\t} else {\n+\t\tpol->core_share[count].pcpu = pcpu;\n+\t\tRTE_LOG(INFO, CHANNEL_MONITOR,\n+\t\t\t\t\"Monitoring pcpu %d for %s\\n\",\n+\t\t\t\tpcpu, pol->pkt.vm_name);\n+\t}\n+\treturn ret;\n+}\n+\n static void\n get_pcpu_to_control(struct policy *pol)\n {\n@@ -94,34 +121,42 @@ get_pcpu_to_control(struct policy *pol)\n \tint pcpu, count;\n \tuint64_t mask_u64b;\n \tstruct core_info *ci;\n-\tint ret;\n \n \tci = get_core_info();\n \n-\tRTE_LOG(INFO, CHANNEL_MONITOR, \"Looking for pcpu for %s\\n\",\n-\t\t\tpol->pkt.vm_name);\n-\tget_info_vm(pol->pkt.vm_name, &info);\n-\n-\tfor (count = 0; count < pol->pkt.num_vcpu; count++) {\n-\t\tmask_u64b = info.pcpu_mask[pol->pkt.vcpu_to_control[count]];\n-\t\tfor (pcpu = 0; mask_u64b; mask_u64b &= ~(1ULL << pcpu++)) {\n-\t\t\tif ((mask_u64b >> pcpu) & 1) {\n-\t\t\t\tif (pol->pkt.policy_to_use == BRANCH_RATIO) {\n-\t\t\t\t\tci->cd[pcpu].oob_enabled = 1;\n-\t\t\t\t\tret = add_core_to_monitor(pcpu);\n-\t\t\t\t\tif (ret == 0)\n-\t\t\t\t\t\tprintf(\"Monitoring pcpu %d via Branch Ratio\\n\",\n-\t\t\t\t\t\t\t\tpcpu);\n-\t\t\t\t\telse\n-\t\t\t\t\t\tprintf(\"Failed to start OOB Monitoring pcpu %d\\n\",\n-\t\t\t\t\t\t\t\tpcpu);\n-\n-\t\t\t\t} else {\n-\t\t\t\t\tpol->core_share[count].pcpu = pcpu;\n-\t\t\t\t\tprintf(\"Monitoring pcpu %d\\n\", pcpu);\n-\t\t\t\t}\n+\tRTE_LOG(INFO, CHANNEL_MONITOR,\n+\t\t\t\"Looking for pcpu for %s\\n\", pol->pkt.vm_name);\n+\n+\t/*\n+\t * So now that we're handling virtual and physical cores, we need to\n+\t * differenciate between them when adding them to the branch monitor.\n+\t * Virtual cores need to be converted to physical cores.\n+\t */\n+\tif (pol->pkt.core_type == CORE_TYPE_VIRTUAL) {\n+\t\t/*\n+\t\t * If the cores in the policy are virtual, we need to map them\n+\t\t * to physical core. We look up the vm info and use that for\n+\t\t * the mapping.\n+\t\t */\n+\t\tget_info_vm(pol->pkt.vm_name, &info);\n+\t\tfor (count = 0; count < pol->pkt.num_vcpu; count++) {\n+\t\t\tmask_u64b =\n+\t\t\t\tinfo.pcpu_mask[pol->pkt.vcpu_to_control[count]];\n+\t\t\tfor (pcpu = 0; mask_u64b;\n+\t\t\t\t\tmask_u64b &= ~(1ULL << pcpu++)) {\n+\t\t\t\tif ((mask_u64b >> pcpu) & 1)\n+\t\t\t\t\tpcpu_monitor(pol, ci, pcpu, count);\n \t\t\t}\n \t\t}\n+\t} else {\n+\t\t/*\n+\t\t * If the cores in the policy are physical, we just use\n+\t\t * those core id's directly.\n+\t\t */\n+\t\tfor (count = 0; count < pol->pkt.num_vcpu; count++) {\n+\t\t\tpcpu = pol->pkt.vcpu_to_control[count];\n+\t\t\tpcpu_monitor(pol, ci, pcpu, count);\n+\t\t}\n \t}\n }\n \n@@ -160,8 +195,13 @@ update_policy(struct channel_packet *pkt)\n \tunsigned int updated = 0;\n \tint i;\n \n+\n+\tRTE_LOG(INFO, CHANNEL_MONITOR,\n+\t\t\t\"Applying policy for %s\\n\", pkt->vm_name);\n+\n \tfor (i = 0; i < MAX_VMS; i++) {\n \t\tif (strcmp(policies[i].pkt.vm_name, pkt->vm_name) == 0) {\n+\t\t\t/* Copy the contents of *pkt into the policy.pkt */\n \t\t\tpolicies[i].pkt = *pkt;\n \t\t\tget_pcpu_to_control(&policies[i]);\n \t\t\tif (get_pfid(&policies[i]) == -1) {\n@@ -189,6 +229,24 @@ update_policy(struct channel_packet *pkt)\n \treturn 0;\n }\n \n+static int\n+remove_policy(struct channel_packet *pkt __rte_unused)\n+{\n+\tint i;\n+\n+\t/*\n+\t * Disabling the policy is simply a case of setting\n+\t * enabled to 0\n+\t */\n+\tfor (i = 0; i < MAX_VMS; i++) {\n+\t\tif (strcmp(policies[i].pkt.vm_name, pkt->vm_name) == 0) {\n+\t\t\tpolicies[i].enabled = 0;\n+\t\t\treturn 0;\n+\t\t}\n+\t}\n+\treturn -1;\n+}\n+\n static uint64_t\n get_pkt_diff(struct policy *pol)\n {\n@@ -346,7 +404,6 @@ apply_policy(struct policy *pol)\n \t\tapply_workload_profile(pol);\n }\n \n-\n static int\n process_request(struct channel_packet *pkt, struct channel_info *chan_info)\n {\n@@ -355,6 +412,8 @@ process_request(struct channel_packet *pkt, struct channel_info *chan_info)\n \tif (chan_info == NULL)\n \t\treturn -1;\n \n+\tRTE_LOG(INFO, CHANNEL_MONITOR, \"Processing Request %s\\n\", pkt->vm_name);\n+\n \tif (rte_atomic32_cmpset(&(chan_info->status), CHANNEL_MGR_CHANNEL_CONNECTED,\n \t\t\tCHANNEL_MGR_CHANNEL_PROCESSING) == 0)\n \t\treturn -1;\n@@ -362,10 +421,12 @@ process_request(struct channel_packet *pkt, struct channel_info *chan_info)\n \tif (pkt->command == CPU_POWER) {\n \t\tcore_mask = get_pcpus_mask(chan_info, pkt->resource_id);\n \t\tif (core_mask == 0) {\n-\t\t\tRTE_LOG(ERR, CHANNEL_MONITOR, \"Error get physical CPU mask for \"\n-\t\t\t\t\"channel '%s' using vCPU(%u)\\n\", chan_info->channel_path,\n-\t\t\t\t(unsigned)pkt->unit);\n-\t\t\treturn -1;\n+\t\t\t/*\n+\t\t\t * Core mask will be 0 in the case where\n+\t\t\t * hypervisor is not available so we're working in\n+\t\t\t * the host, so use the core as the mask.\n+\t\t\t */\n+\t\t\tcore_mask = 1ULL << pkt->resource_id;\n \t\t}\n \t\tif (__builtin_popcountll(core_mask) == 1) {\n \n@@ -421,12 +482,20 @@ process_request(struct channel_packet *pkt, struct channel_info *chan_info)\n \t}\n \n \tif (pkt->command == PKT_POLICY) {\n-\t\tRTE_LOG(INFO, CHANNEL_MONITOR, \"\\nProcessing Policy request from Guest\\n\");\n+\t\tRTE_LOG(INFO, CHANNEL_MONITOR,\n+\t\t\t\t\"\\nProcessing Policy request\\n\");\n \t\tupdate_policy(pkt);\n \t\tpolicy_is_set = 1;\n \t}\n \n-\t/* Return is not checked as channel status may have been set to DISABLED\n+\tif (pkt->command == PKT_POLICY_REMOVE) {\n+\t\tRTE_LOG(INFO, CHANNEL_MONITOR,\n+\t\t\t\t \"Removing policy %s\\n\", pkt->vm_name);\n+\t\tremove_policy(pkt);\n+\t}\n+\n+\t/*\n+\t * Return is not checked as channel status may have been set to DISABLED\n \t * from management thread\n \t */\n \trte_atomic32_cmpset(&(chan_info->status), CHANNEL_MGR_CHANNEL_PROCESSING,\n@@ -448,13 +517,16 @@ add_channel_to_monitor(struct channel_info **chan_info)\n \t\t\t\t\"to epoll\\n\", info->channel_path);\n \t\treturn -1;\n \t}\n+\tRTE_LOG(ERR, CHANNEL_MONITOR, \"Added channel '%s' \"\n+\t\t\t\"to monitor\\n\", info->channel_path);\n \treturn 0;\n }\n \n int\n remove_channel_from_monitor(struct channel_info *chan_info)\n {\n-\tif (epoll_ctl(global_event_fd, EPOLL_CTL_DEL, chan_info->fd, NULL) < 0) {\n+\tif (epoll_ctl(global_event_fd, EPOLL_CTL_DEL,\n+\t\t\tchan_info->fd, NULL) < 0) {\n \t\tRTE_LOG(ERR, CHANNEL_MONITOR, \"Unable to remove channel '%s' \"\n \t\t\t\t\"from epoll\\n\", chan_info->channel_path);\n \t\treturn -1;\n@@ -467,11 +539,13 @@ channel_monitor_init(void)\n {\n \tglobal_event_fd = epoll_create1(0);\n \tif (global_event_fd == 0) {\n-\t\tRTE_LOG(ERR, CHANNEL_MONITOR, \"Error creating epoll context with \"\n-\t\t\t\t\"error %s\\n\", strerror(errno));\n+\t\tRTE_LOG(ERR, CHANNEL_MONITOR,\n+\t\t\t\t\"Error creating epoll context with error %s\\n\",\n+\t\t\t\tstrerror(errno));\n \t\treturn -1;\n \t}\n-\tglobal_events_list = rte_malloc(\"epoll_events\", sizeof(*global_events_list)\n+\tglobal_events_list = rte_malloc(\"epoll_events\",\n+\t\t\tsizeof(*global_events_list)\n \t\t\t* MAX_EVENTS, RTE_CACHE_LINE_SIZE);\n \tif (global_events_list == NULL) {\n \t\tRTE_LOG(ERR, CHANNEL_MONITOR, \"Unable to rte_malloc for \"\ndiff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c\nindex 58c5fa45c..893bf4cdd 100644\n--- a/examples/vm_power_manager/main.c\n+++ b/examples/vm_power_manager/main.c\n@@ -421,6 +421,8 @@ main(int argc, char **argv)\n \t\treturn -1;\n \t}\n \n+\tadd_host_channel();\n+\n \tprintf(\"Running core monitor on lcore id %d\\n\", lcore_id);\n \trte_eal_remote_launch(run_core_monitor, NULL, lcore_id);\n \n",
    "prefixes": [
        "v5",
        "05/10"
    ]
}