Show a patch.

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

{
    "id": 44725,
    "url": "http://patches.dpdk.org/api/patches/44725/",
    "web_url": "http://patches.dpdk.org/patch/44725/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20180914135406.52190-5-david.hunt@intel.com>",
    "date": "2018-09-14T13:54:02",
    "name": "[v3,4/8] examples/power: add host channel to power manager",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "207e8e09891bcd6de1435dd65504bbb31840eae8",
    "submitter": {
        "id": 342,
        "url": "http://patches.dpdk.org/api/people/342/",
        "name": "David Hunt",
        "email": "david.hunt@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/patch/44725/mbox/",
    "series": [
        {
            "id": 1322,
            "url": "http://patches.dpdk.org/api/series/1322/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1322",
            "date": "2018-09-14T13:53:58",
            "name": "add json power policy interface for containers",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/1322/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/44725/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/44725/checks/",
    "tags": {},
    "headers": {
        "X-Mailman-Version": "2.1.15",
        "X-ExtLoop1": "1",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Mailer": "git-send-email 2.17.1",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 03E035F27;\n\tFri, 14 Sep 2018 15:54:23 +0200 (CEST)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id A665F58C4\n\tfor <dev@dpdk.org>; Fri, 14 Sep 2018 15:54:17 +0200 (CEST)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t14 Sep 2018 06:54:17 -0700",
            "from silpixa00399952.ir.intel.com (HELO\n\tsilpixa00399952.ger.corp.intel.com) ([10.237.223.64])\n\tby orsmga005.jf.intel.com with ESMTP; 14 Sep 2018 06:54:15 -0700"
        ],
        "References": "<20180912144930.50578-1-david.hunt@intel.com>\n\t<20180914135406.52190-1-david.hunt@intel.com>",
        "X-Amp-File-Uploaded": "False",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<20180914135406.52190-5-david.hunt@intel.com>",
        "X-IronPort-AV": "E=Sophos;i=\"5.53,373,1531810800\"; d=\"scan'208\";a=\"257257217\"",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Precedence": "list",
        "From": "David Hunt <david.hunt@intel.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "In-Reply-To": "<20180914135406.52190-1-david.hunt@intel.com>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "To": "dev@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Date": "Fri, 14 Sep 2018 14:54:02 +0100",
        "Cc": "john.mcnamara@intel.com, stephen@networkplumber.org, lei.a.yao@intel.com,\n\tbruce.richardson@intel.com, David Hunt <david.hunt@intel.com>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Subject": "[dpdk-dev] [PATCH v3 4/8] examples/power: add host channel to power\n\tmanager"
    },
    "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.0\n\nSigned-off-by: David Hunt <david.hunt@intel.com>\n---\n examples/vm_power_manager/channel_manager.c | 108 +++++++++++++++\n examples/vm_power_manager/channel_manager.h |  17 ++-\n examples/vm_power_manager/channel_monitor.c | 146 +++++++++++++++-----\n examples/vm_power_manager/main.c            |   2 +\n 4 files changed, 238 insertions(+), 35 deletions(-)",
    "diff": "diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c\nindex 2e471d0c1..88ae108a6 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,35 @@ setup_channel_info(struct virtual_machine_info **vm_info_dptr,\n \treturn 0;\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 *)0;\n+\tchan_info->status = CHANNEL_MGR_CHANNEL_DISCONNECTED;\n+\tchan_info->type = CHANNEL_TYPE_JSON;\n+\tsprintf(chan_info->channel_path, \"%sfifo.0\", CHANNEL_MGR_SOCKET_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 +533,51 @@ 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+\tsnprintf(socket_path, sizeof(socket_path), \"%sfifo.%u\",\n+\t\t\tCHANNEL_MGR_SOCKET_PATH, 0);\n+\n+\terrno = 0;\n+\tret = mkfifo(socket_path, 0666);\n+\tif ((errno != EEXIST) && (ret < 0)) {\n+\t\tprintf(\" %d %d, %d\\n\", ret, EEXIST, errno);\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+\terrno = 0;\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),\n+\t\t\tRTE_CACHE_LINE_SIZE);\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), \"%sfifo.%u\",\n+\t\t\tCHANNEL_MGR_SOCKET_PATH, 0);\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..c157cc22b 100644\n--- a/examples/vm_power_manager/channel_manager.h\n+++ b/examples/vm_power_manager/channel_manager.h\n@@ -37,7 +37,7 @@ struct sockaddr_un _sockaddr_un;\n #define UNIX_PATH_MAX sizeof(_sockaddr_un.sun_path)\n #endif\n \n-#define MAX_VMS 4\n+#define MAX_VMS 64\n #define MAX_VCPUS 20\n \n \n@@ -54,6 +54,11 @@ 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 { CHANNEL_TYPE_BINARY = 0,\n+\tCHANNEL_TYPE_INI,\n+\tCHANNEL_TYPE_JSON};\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 +71,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 +232,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..17383e9d2 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,46 @@ 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+\n+\n+\n+\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 +199,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 +233,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 +408,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 +416,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 +425,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 = 1 << pkt->resource_id;\n \t\t}\n \t\tif (__builtin_popcountll(core_mask) == 1) {\n \n@@ -421,12 +486,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 +521,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 +543,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": [
        "v3",
        "4/8"
    ]
}